MUSTAFA PATAN
Published © GPL3+

Arduino & Xbee Remote Lamp Controller

Remote Lamp on off control with arduino & xbee shield

IntermediateShowcase (no instructions)1,785
Arduino & Xbee Remote Lamp Controller

Things used in this project

Hardware components

DevreMatik v1.0 Arduino & Xbee Remote Lamp Controller
×1

Software apps and online services

Arduino IDE
Arduino IDE
www.devrematik.com

Story

Read more

Schematics

Button Side And Lamp side Schematics

Bitmap image file

Code

v1.0 Arduino & Xbee Remote Lamp Controller

Arduino
Button side and Lamp side programs
//*******BUTTON SIDE CODES*********
const int SW_ON = 6;     // the number of the pushbutton pin
const int SW_OFF = 7;     // the number of the pushbutton pin
const int ledPin =  9;      // the number of the LED pin

int lamba = 0;  


void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(SW_ON, INPUT);
  pinMode(SW_OFF, INPUT);
  Serial.begin(9600);
  lamba=0;
}

void loop() {
  delay(100);
  if(digitalRead(SW_ON)==  LOW){    digitalWrite(ledPin, LOW);  delay(250);  lamba=1;}  
  if(digitalRead(SW_OFF)== LOW){    digitalWrite(ledPin, HIGH);  delay(250); lamba=0;}  
  if(lamba==1) Serial.print("A"); else Serial.print("K");
}


//************LAMP SIDE CODES ***************
const int ledPin =  9;      // the number of the LED pin

int lamba = 0;  


void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  lamba=0;
}

void loop() {
  if (Serial.available() > 0) {    
    lamba = Serial.read();
    if(lamba == 75) {digitalWrite(ledPin, LOW);}
    if(lamba == 65) {digitalWrite(ledPin, HIGH);}
  }

}

Credits

MUSTAFA PATAN

MUSTAFA PATAN

1 project • 3 followers
www.devrematik.com

Comments