Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char val; // variable to receive data from the serial port
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600); // start serial communication at 9600bps
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if( Serial.available() ) // if data is available to read
- {
- val = Serial.read();
- Serial.print(val);
- }
- if( val == 'H' ) // if 'H' was received
- {
- Serial.print(val);
- } else {
- Serial.print(val);
- }
- delay(100); // wait 100ms for next reading
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement