Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years ago.
I can't visualize Temperature (MLX90614) on DISCO-F429ZI's LCD!
Hello everyone, I'm using the ST-Discovery-F429ZI, and i'm trying to work the MLX90614 sensor on it. Unfortunately i'm not able to visualize the temperature's result on its own LCD screen. Can somebody help me?
I suppose i should write in main.cpp che command:
"#include "LCD_DISCO_F429ZI.h"
but i'm not sure about it...please help me, it's for an exam.
2 Answers
5 years, 10 months ago.
Tenia el mismo problema la solución es declarar una variable char y usar el sprintf que convierte en string mi codigo es el siguiente
- include "mbed.h"
- include "LCD_DISCO_F429ZI.h"
LCD_DISCO_F429ZI lcd; int dato=2; char texto[20]; int main() { lcd.Clear(LCD_COLOR_BLUE); lcd.SetBackColor(LCD_COLOR_BLUE); lcd.SetTextColor(LCD_COLOR_WHITE); lcd.DisplayStringAt(0,LINE(1), (uint8_t *)"Master", CENTER_MODE); wait(2); while(1) { lcd.Clear(LCD_COLOR_BLUE); lcd.SetBackColor(LCD_COLOR_BLUE); lcd.SetTextColor(LCD_COLOR_WHITE); lcd.DisplayStringAt(0,LINE(1), (uint8_t *)"Master ", CENTER_MODE); sprintf((char*)texto, "Sensor 1 = %3d", dato); lcd.DisplayStringAt(0, LINE(2), (uint8_t *)&texto, CENTER_MODE); wait(1); } }
7 years ago.
Gianfilippo,
Can you share a link to your project, or provide more detailed code snippets that showcase how you are getting data from the , as well as how you are printing to the LCD screen?
There is an example on how to use the MLX90614 with I2C located here. Review the wiring diagram, and make sure you can print out the temperature to the serial bus.
Next, verify that you can print data to the LCD screen. There is an example that shows how to do this here
Austin has provided you with some additional details in the last question you posted.