Skip to content

Instantly share code, notes, and snippets.

/gist:2980344
Created Jun 23, 2012

Embed
What would you like to do?
Arduino call/response program
/* This sketch waits for incoming serial data to be present
and then sends a message serially.
After Serial.println() is a call to Serial.read() to remove
the received byte from the input queue. If you send more than
one byte to the Arduino, you'll get more than one response sent
back at you.
*/
void setup()
{
Serial.begin(9600);
}
void loop()
{
if (Serial.available() > 0)
{
Serial.println("Hello");
Serial.read();
}
}
@balli21nov

This comment has been minimized.

Copy link

commented Apr 6, 2016

Hi Anonymous
i want to read the values from a temperature sensor using arduino in my c code can you help me with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.