This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
#include <termios.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <wiringPi.h> | |
#include <wiringSerial.h> | |
#include <vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(10, 11); // RX, TX | |
void setup() { | |
Serial.begin(9600); | |
while (!Serial) { | |
; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(13, 12); // RX, TX | |
void setup() { | |
Serial.begin(38400); //Baud Rate | |
mySerial.begin(38400); | |
} | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/boot.h> | |
void print_val(char *msg, uint8_t val) | |
{ | |
Serial.print(msg); | |
Serial.println(val, HEX); | |
} | |
void setup(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned int i = 0; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
char buffer[50]; | |
sprintf(buffer, "Value: %x", i++); | |
Serial.println(buffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/boot.h> | |
void setup(void) | |
{ | |
Serial.begin(9600); | |
Serial.println(GetUID()); | |
} | |
void loop() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(9600); | |
String stringValue; | |
String stringValue1; | |
String stringValue2; | |
stringValue = "ReadData: 1997"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(9600); | |
String hexstring = "FB"; | |
int number = (int) strtol( &hexstring[0], NULL, 16); | |
Serial.println(number); | |
} | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EEPROM.h> | |
char example_string[] = "~New eeprom string"; | |
const int eeprom_size = 500; // values saved in eeprom should never exceed 500 bytes | |
char eeprom_buffer[eeprom_size]; | |
char first_eeprom_value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long Watch, _micro, time = micros(); | |
unsigned int Clock = 0, R_clock; | |
boolean Reset = false, Stop = false, Paused = false; | |
volatile boolean timeFlag = false; | |
void setup() | |
{ | |
Serial.begin(115200); | |
SetTimer(0,0,10); // 10 seconds | |
StartTimer(); |