-
-
Save kjooeun97/b1cadd8ca30974a8a889 to your computer and use it in GitHub Desktop.
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(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