Skip to content

Instantly share code, notes, and snippets.

@kjooeun97
Created February 24, 2014 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjooeun97/b1cadd8ca30974a8a889 to your computer and use it in GitHub Desktop.
Save kjooeun97/b1cadd8ca30974a8a889 to your computer and use it in GitHub Desktop.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 5);
int x = 1504;
int y = 1513;
char val;
void setup()
{
Serial.begin(9600);
while(!Serial) {
;
}
mySerial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,Time,number,name");
}
void loop()
{
if (mySerial.available()>0)
{
val = mySerial.read();
if (val == 'F') {
Serial.print("DATA,TIME,"); Serial.print(x); Serial.print(","); Serial.println("Kim kyoung man");
}
else if (val == 'D') {
Serial.print("DATA,TIME,"); Serial.print(y); Serial.print(","); Serial.println("Park sang bin");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment