Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////
- // Simple APC220 Receiver Arduino Code
- // by
- // Kaleb Hill
- // 5/30/15
- ////////////////////////////////////////////////
- void setup()
- {
- Serial.begin(9600);
- pinMode(13,OUTPUT);
- }
- void loop()
- { int Data;
- if(Serial.available()>0){
- Data = Serial.read();
- Serial.flush();
- }
- switch ( Data ) {
- case '0':
- lowvalue();
- break;
- case '1':
- highvalue();
- break;
- default :
- break;
- }
- delay(1);
- }
- void lowvalue()
- {
- digitalWrite(13, LOW);
- Serial.println("0");
- }
- void highvalue()
- {
- digitalWrite(13, HIGH);
- Serial.println("1");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement