OLED Display / Clock / Temperature
Posted: Sun Dec 27, 2015 9:42 pm
Hey Group,
I knocked up this test circuit that uses an I2C OLED display and 3 ds18B20 temp sensors.
It shows the date/time and the Centigrade value of the three temp sensors.
The temperature updates every 5 seconds.
The time updates every 30 seconds.
By the way it is running off an old cell phone battery at 3.3 vdc
It continues to amaze me at the power of this ESP BASIC and the little ESP-01 module.
Take note that the display and the three temp sensors all share the same data/clock pin.
@Mike... feel free to post this as an example project if you like.
regards, Dwight
If you want to convert to Farenheit...
I knocked up this test circuit that uses an I2C OLED display and 3 ds18B20 temp sensors.
It shows the date/time and the Centigrade value of the three temp sensors.
The temperature updates every 5 seconds.
The time updates every 30 seconds.
By the way it is running off an old cell phone battery at 3.3 vdc
It continues to amaze me at the power of this ESP BASIC and the little ESP-01 module.
Take note that the display and the three temp sensors all share the same data/clock pin.
@Mike... feel free to post this as an example project if you like.
regards, Dwight
Code: Select all
memclear
cls
oledcls
counter = 0
timesetup(-7,0)
delay 1000
button "Temperature" [gettemp]
button "Exit " [Exit]
gosub [gettime]
timer 5000 [gettemp]
wait
'
[gettemp]
counter = counter + 1
if counter = 6 then gosub [gettime]
temp 0 curr
oledprint curr 0 0
temp 1 curr
oledprint curr 0 2
temp 2 curr
oledprint curr 0 4
'
oledprint ramfree() 0 6
oledprint flashfree() 0 7
'
wait
'
[gettime]
counter = 0
bla = time()
dw = mid(bla,1,3) 'dow
mh = mid(bla,5,3) 'month
dt = mid(bla,9,2) 'date
hh = mid(bla,12,2) 'hour
mm = mid(bla,15,2) 'min
ss = mid(bla,18,2) 'sec
yr = mid(bla,21,4) 'year
oledprint dw 8 0
oledprint mh 8 1
oledprint dt 12 1
oledprint yr 8 2
oledprint hh 8 4
oledprint ":" 10 4
oledprint mm 11 4
'
return
[Exit]
end
If you want to convert to Farenheit...
Code: Select all
temp 0 curr
tf = curr * 9
tf = tf / 5
tf = tf + 32
PRINT tf