Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2012 22:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/2980344 to your computer and use it in GitHub Desktop.
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
Copy link

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