Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- while (!Serial) {};
- Serial.println("start_tc_measurement");
- pinMode(myPinLed, OUTPUT);
- startTime = millis();
- }
- void SerialListen() {
- comString = "";
- if (Serial.available() > 0) {
- delay(10);
- bool stringComplete;
- stringComplete = false;
- while (!stringComplete) {
- char inChar = (char)Serial.read();
- comString += inChar;
- if (inChar == '\n') stringComplete = true;
- }
- Serial.println(String("Command received = ") + comString);
- if (comString.startsWith("stop")) state = 0;
- if (comString.startsWith("run")) state = 1;
- if (comString.startsWith("set")) state = 2;
- }
- //Serial.println(command);
- //if (command.startsWith("setfun")) Serial.println("Set Function");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement