Last active
March 13, 2018 03:16
-
-
Save tuttelikz/1574f56301a6b90c129c981116c8c241 to your computer and use it in GitHub Desktop.
Script to send sensor information with bluetooth to terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
SoftwareSerial BTserial(10,11); // RX | TX | |
int sensorPin = A3; | |
int sensorValue = 0; | |
void setup() | |
{ | |
Serial.begin(9600); | |
Serial.println("Begin"); | |
BTserial.begin(9600); | |
} | |
void loop() | |
{ | |
sensorValue = analogRead(sensorPin); | |
Serial.write(BTserial.read()); | |
Serial.println(sensorValue); | |
BTserial.write(Serial.read()); | |
BTserial.println(sensorValue); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment