Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Great day ! I need help on my Arduino code. Here is my setup

LM35 connected to Arduino with output connected to Analog 0

Temperature computation work and serial monitor displays the correct reading

I want to connect the bluetooth to Android app(taken form the link) to display the temperature https://play.google.com/store/apps/details?id=appinventor.ai_Muhandi_prasetyo.LM35&hl=en

It displays for a few times but 98 % of the time it doesn't display it on the app. I'm thinking it may be on the code that i have

    #include <SoftwareSerial.h> 
    #define RxD 6 
    #define TxD 7 
     float temp; 
     int temperaturePin = 0; 
     float  temp1;
     SoftwareSerial blueToothSerial(RxD,TxD);

    void setup() { 
    Serial.begin(9600); 
    pinMode(RxD, INPUT); 
    pinMode(TxD, OUTPUT); 
     } 
    void loop() {
    temp = analogRead(temperaturePin);
    temp1 = temp * 0.48828125; 
    Serial.print(temp1); 
    delay(1000); 
    blueToothSerial.print(temp1);
    delay(1000);
    }

I just really want to make it simple. Kindly help

share|improve this question

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

    
Are you using the HC-05 Bluetooth module? – Adrian Nov 20 '15 at 23:52
    
yes - I figured it out already Adrian. the code found on this link is simpler and it worked [link] (pastebin.com/343EUh4v). I just need to run the code first in arduino before putting/connecting the bluetooth shield – coollearner Nov 22 '15 at 15:15

try to use Pin 1 and 2 for your bluetooth and change the code

share|improve this answer
    
Can you explain more? This is pretty brief. Change the code to what? – Nick Gammon Aug 19 '16 at 11:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.