test_serial.cpp.ino 276 B

123456789101112131415
  1. [sourcecode language=”cpp”]
  2. byte number = 0;
  3. void setup(){
  4. Serial.begin(9600);
  5. }
  6. void loop(){
  7. if (Serial.available()) {
  8. number = Serial.read();
  9. Serial.print(“character recieved: “);
  10. Serial.println(number, DEC);
  11. }
  12. }
  13. [/sourcecode]