Cooking Hacks Forum
https://www.cooking-hacks.com/forum/

Temperature sensor giving garbage in Serial port
https://www.cooking-hacks.com/forum/viewtopic.php?f=39&t=16810
Page 1 of 1

Author:  ncraghunc [ Sun Sep 16, 2018 9:56 pm ]
Post subject:  Temperature sensor giving garbage in Serial port

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

Author:  libelium-dev [ Mon Sep 17, 2018 8:23 am ]
Post subject:  Re: Temperature sensor giving garbage in Serial port

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/