SPECIFICATION
DOCUMENTS
DFRobot Leonardo & Xbee R3 x 1
DFRobot Leonardo with Xbee R3 has a Xbee socket.It uses Serial1 to communicate with Leonardo.
// # Description:
// It is just used to test Leonardo module
// Write by Grey
// Input "p" once time the led will be turn on;twice to turn off.
// It is controled by Serial1 Xbee side only. but you can check the status from serial port.
int ledPin=13;
int val;
int count=0;
void setup()
{
pinMode(ledPin,OUTPUT);
Serial.begin(9600);
Serial1.begin(115200); // Xbee Serial1 port baud rate should be set the same to the xbee baud rate
}
void loop()
{
val=Serial1.read(); // read xbee Serial1 data
if(-1!=val) // "-1" means no data
{
if('p'==val){
if(count==0)count=1;
else if(count==1)count=0;
}
if(count==0){
digitalWrite(ledPin,HIGH); // Turn on
Serial.println("LED ON"); // you can check the status from serial port.
Serial1.println("LED ON"); //you can check the status from serial1 port(xbee).
}
else if(count==1)
{
digitalWrite(ledPin,LOW); // Turn off
Serial.println("LED OFF"); //you can check the status from serial port.
Serial1.println("LED OFF"); //you can check the status from serial1 port(xbee).
}
}
}
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,375,394 ครั้ง |
ผู้ชมทั้งหมด | 5,878,472 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 5 ก.ย. 2568 |