Last active
December 17, 2015 01:39
-
-
Save shahrulnizam/5530073 to your computer and use it in GitHub Desktop.
ChipKIT Lesson: Serial Communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Project: Serial Communication Lesson | |
Programmer: Shahrulnizam Mat Rejab | |
Board: Chipkit UNO32/MAX32 | |
Last Modified: 16 January 2014 | |
Website: http://shahrulnizam.com | |
*/ | |
int data; | |
void setup() | |
{ | |
Serial.begin(9600); | |
Serial.println("Serial Ready!"); | |
} | |
void loop() | |
{ | |
if(Serial.available()>0) | |
{ | |
Serial.print("You type: "); | |
while(Serial.available()>0) | |
{ | |
data=Serial.read(); | |
Serial.write(data); | |
} | |
Serial.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment