Advertisement
a5768549

cooking machine

Jan 12th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <SoftwareSerial.h>
  2. #include <Wire.h>
  3. SoftwareSerial I2CBT(10,11);
  4.  
  5. void setup()
  6. {
  7.   Serial.begin(9600);
  8.   I2CBT.begin(9600);
  9. }
  10.  
  11. void loop()
  12. {
  13.   byte cmmd[20];
  14.   int insize;
  15.   char c = ' ';
  16.   if (I2CBT.available())
  17.   {  //判斷有沒有訊息接收
  18.       c = I2CBT.read();
  19.       Serial.write(c);  
  20.   }
  21.   switch (c)
  22.   {
  23.     case 'a':  
  24.       Serial.println("AAAAAAA");//將接收的訊息顯示出來
  25.     break;  
  26.  
  27.     case 98:
  28.     break;
  29.   }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement