Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial bt(8,10);
- int val;
- char c;
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- bt.begin(9600);
- delay(1000);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- val = 0;
- if(Serial.available()) {
- c = Serial.read();
- //Serial.println(c, DEC);
- //val = val * 10 + (c - 48);
- val = c;
- }
- if (val != 0) {
- //val = (val - (c - 48)) / 10;
- Serial.println(val);
- bt.write(val);
- }
- //Serial.println();
- delay(50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement