Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- #include <Wire.h>
- SoftwareSerial I2CBT(10,11);
- void setup()
- {
- Serial.begin(9600);
- I2CBT.begin(9600);
- }
- void loop()
- {
- byte cmmd[20];
- int insize;
- char c = ' ';
- if (I2CBT.available())
- { //判斷有沒有訊息接收
- c = I2CBT.read();
- Serial.write(c);
- }
- switch (c)
- {
- case 'a':
- Serial.println("AAAAAAA");//將接收的訊息顯示出來
- break;
- case 98:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement