Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial BT(2,3); //RX,TX
- int buttonRead1;
- int buttonRead2;
- int buttonPin1 = 11 ;
- int buttonPin2 = 12 ;
- void setup()
- {
- pinMode(buttonPin1, INPUT_PULLUP);
- pinMode(buttonPin2, INPUT_PULLUP);
- Serial.begin(9600);
- BT.begin(9600);
- }
- void loop()
- {
- buttonRead1 = digitalRead(buttonPin1);
- buttonRead2 = digitalRead(buttonPin2);
- if(buttonRead1 == 0)
- {
- BT.write('a');
- }
- if(buttonRead2 == 0)
- {
- BT.write('b');
- }
- /* if(buttonRead1 == 1 && buttonRead2 == 1)
- {
- Serial.write('w');
- delay(10);
- }*/
- Serial.print(buttonRead1);
- Serial.println(buttonRead2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement