United Kingdom
Asked — Edited

Display Ez-B V4 Info On Lcd Display

Any ideas in how can I display my v4's CPU temp and battery voltage on an LCD05 16x2 display? I looked for possible variables to do something like the following but couldn't find any...

#NOTE: Non working code's for example
#purposes only

i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"CPU temp is " + $CPUtemp)


i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"Battery voltage is " + $BatteryVoltage)

Any ideas guys as I'm not sure what to do next to create a variable to be read and displayed on the LCD?



Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.


There are script commands for this (from the script manual):

         Returns the CPU Temperature of the EZ-B v4
         Example: $x = GetCPUTemp()
         Returns the EZ-B v4 Battery Voltage
         Example: $x = GetVoltage()


United Kingdom

Thanks for the reply Alan.

Lol, yep, completely overlooked that. Thanks for that Alan. Very much appreciated:).

For anyone else who may be looking do do this, make a script with the following...

#This example is for an LCD05 16x2

#Initiate variable
$CPUtemp = getCPUTtemp()
#Displays current information
i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"The CPU temperature is " + $CPUtemp)

This script could be in a script manager and the CPU temp at that point will be displayed when it is run. (See next post for advice on automatically updating the temp).



If you only put that in the init, you will only ever have the value on startup. You'l either need a loop or a waitforchange to keep it updated.


United Kingdom


Good point. Although I kinda meant put the "Init" in a connection script, and run the display temp script when desired, but I see what you mean now. I've edited the post above to make that a bit clearer. Thanks again buddy. The way I'm using it is to scroll through different information (time, date, voltage, CPU ect) every few seconds.

#This example is for an LCD05 16x2

$cpu = getcputemp()
$voltage = getvoltage()
i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"Date: " + $date)
i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"v4 battery is at   " + $voltage, " Volts")
i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255," CPU temp is at   " + $cpu, " Celsius")
i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"    Time is         " + $time)

One quick question, on the message script, what do I need to add to get it to display "Celsius" or "Volts" after the variable so it displays, for example, "v4 battery is at 7.2 volts"? At the moment, it's just displaying the 7.2.

United Kingdom

Not to worry. I figured it out.;)

i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"v4 battery is at " + $voltage," Volts.")

@Steve, do you have a link on where to buy/more information on the "LCD005" display?

United Kingdom

I use;

i2cwrite(0,0xc6,0,1,4,12,19,30,230,31,255,"v4 battery is at " + GetVoltage() + " Volts.")

Loop that with a 1000ms sleep or flip flop between voltage and temp. Melvin cycled through voltage, temperatures, time and date changing every 5000ms which looked fine, worked well and kept the demand down.