Hi all,
I've been working on my Arduino project for quite a while now, managed to process the incoming data in the Arduino and display it on LCD (data is coming from a simulation on the laptop). But I cannot manage to view this data on my Android App (used MIT App Inventor) via Bluetooth (HC-06). I have managed to do this but after a week I tested it again and found some errors (I think problem was with my hardware) therefore (silly me) I didnt save the sketch, therefore blocks in MIT App Inventor are 100% working.
Also, I am connecting RX pin of Bluetooth through a voltage divider with pin 7. Any ideas pls?
Arduino sketch:
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
byte myByte; // Storing the incoming data from serial port
int txPin = 7;
int rxPin =6;
lcd(12,11,5,4,3,2) //pin of lcd ****I know this is not the exact command
SoftwareSerial BlueToothConnect(txPin, rxPin);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
void setup(){
lcd.begin(16,2);
Serial.begin(9600); //Serial communication
}
void loop(){
if(Serial.available(){
lcd.clear();
while(Serial.available()>0){ //Until data is being found in Serial, turn on serial on Bluetooth
BlueToothConnect.begin(9600);
myByte = Serial.read(); //reading the myByte data
lcd.write(myByte); //showing data on LCD
Serial.write(myByte) ; //Showing data on serial monitor
txPin = digitalWrite(myByte); //writing myByte content on pin 7 (txPin)
BlueToothConnect.write(txPin); // BlueToothConnect.print(txPin); //displaying content of txPin to be view on Android display
}
Message was edited by: Lor B