Tetrapod Project
utilities.cpp
Go to the documentation of this file.
1 #include "utilities.h"
2 
3 void delay_microseconds(double microsecond_delay)
4 {
5  double timer = micros();
6  while(timer + microsecond_delay > micros());
7 }
8 
9 void printCANMessageData(unsigned char* _can_message)
10 {
11  for(int i = 0; i < 8; i++)
12  {
13  Serial.print("0x");
14  Serial.print(_can_message[i]);
15  Serial.print("\t");
16  }
17  Serial.println("");
18 }
19 
20 void emptyCanMessage(unsigned char* _can_message)
21 {
22  for(int i = 0; i < 8; i++)
23  {
24  _can_message[i] = 0;
25  }
26 }
void delay_microseconds(double microsecond_delay)
Performs a nonblocking delay in the program Functions such as delay might block some interrupts.
Definition: utilities.cpp:3
void printCANMessageData(unsigned char *_can_message)
The function takes in an array and prints the corresponding message to serial print.
Definition: utilities.cpp:9
void emptyCanMessage(unsigned char *_can_message)
The function takes in an array are converts the first 8 elements to zero.
Definition: utilities.cpp:20