Quantcast
Channel: Reprap Forum - Firmware - Marlin
Viewing all articles
Browse latest Browse all 12090

Re: Sending Message to LCD screen

$
0
0
Looking at your code, there are some issues.... mostly with sprintf, It over writes message, and doesnt convert the %f correctly.

  int sensorValue = analogRead(MFC_SENSOR);
  char message[25]; 
  char voltagechararray[6+2]; 
  double voltage = sensorValue * (5.0 / 1023.0);
  dtostrf(voltage, 6, 2, voltagechararray); 
  sprintf(message, "Voltage: %s", voltagechararray); 
  lcd_setstatus(message);

works for me...

Viewing all articles
Browse latest Browse all 12090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>