Bukit Mertajam, Penang

Pinguino + XBee Shield

Pin:

Pin Allocation:

SKXBEE User’s Manual HERE

For more information, please visit HERE

Example: On/Off LED using computer keyboard

Flow Chart:

Program Code:
#define LEDA 7
#define LEDB 8
#define LEDC 9

int caractere;
void setup()
{
pinMode(LEDA,OUTPUT);
pinMode(LEDB,OUTPUT);
pinMode(LEDC,OUTPUT);
Serial.begin(9600);
Serial.printf("Hi I AM PINGUINO");
}

void loop()
{
digitalWrite(LEDA,LOW);
digitalWrite(LEDB,LOW);
digitalWrite(LEDC,LOW);
while(1)
{
if (Serial.available()) 
	{
	 caractere=Serial.read(); 
    Serial.print(caractere); 
    if (caractere=='A') 
    digitalWrite(LEDA,digitalRead(LEDA)^1);
    else if (caractere=='B') 
    digitalWrite(LEDB,digitalRead(LEDB)^1);
    else if (caractere=='C') 
    digitalWrite(LEDC,digitalRead(LEDC)^1); 
	}
}
}

Demonstration:
[youtube]http://www.youtube.com/watch?v=hokNrQKuhac[/youtube]

Buy

[vc_cta h2=”” style=”outline” color=”white” add_button=”left” btn_title=”Cytron XBee Shield” btn_color=”orange” btn_i_icon_fontawesome=”fa fa-opencart” btn_css_animation=”appear” css_animation=”appear” btn_link=”url:http%3A%2F%2Fwww.cytron.com.my%2Fp-shield-xbee||” btn_add_icon=”true”][/vc_cta]

Related Posts

Leave a comment

Get 7 Tips for Developing Electronic Projects
We respect your privacy.
Loading...