Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Temperature sensor giving garbage in Serial port
PostPosted: Sun Sep 16, 2018 9:56 pm 

Joined: Sun Sep 16, 2018 9:41 pm
Posts: 1
Hello team,
The following ccode is creating garbage on serial port .. Provide correct code or let me know whats wrong with it?

Code:
/*

    Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L.
   http://www.libelium.com

    By using it you accept the MySignals Terms and Conditions.
    You can find them at: http://libelium.com/legal

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Version:           0.1
    Design:            David Gascon
    Implementation:    Luis Martin / Victor Boria
*/

#include <MySignals.h>

#include "Wire.h"
#include "SPI.h"


void setup()
{
  Serial.begin(115200);
 
  MySignals.begin();
}


void loop()
{
  float temperature = MySignals.getTemperature();

  Serial.print(F("Temperature (*C): "));       
  Serial.println(temperature, 2); 


  delay(1000);  // wait for a second
}
   


the image is shown below. Kindly help with the correct code.
Also, I need another code for showing the temperature values in TFT (not the graph)

[img] https://image.ibb.co/bXFWKz/Garbage.gif </img>
https://ibb.co/eVjfCK


Top
 Profile  
 
 Post subject: Re: Temperature sensor giving garbage in Serial port
PostPosted: Mon Sep 17, 2018 8:23 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11292
Hi,

You should select the correct baudrate in the serial monitor windows. You should select 115200 in the foldable of the window in the right down corner.

Please for more information about MySignals please check the tutorial,
https://www.cooking-hacks.com/mysignals ... ial/#step5

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.