' demo of HC-SR04 + RTC + OLED connected to Annex32
' a complete help of Annex32 can be found here
' https://cicciocb.com/annex32help/V1.442/
maxscroll.setup 8, 21
maxscroll.print "Hello Mike! "
maxscroll.next "This should meet your needs, I guess :-) "
neo.setup 5, 16
neo.strip 0, 15, 0
i2c.setup 26,25, 400000
oled.init 0
oled.font 2
oled.refresh 0
timer0 50, scrollME
timer1 900, printtime
cnt = 0 : led = 0 : col = &hff0000 : col_p = 0
wait
'###################################################################
'-------------------------------------------------------------------
scrollME:
'-------------------------------------------------------------------
MAXSCROLL.SCROLL 5
cnt = cnt + 1
if (cnt > 3) then
cnt = 0
neo.strip 0, 15, col_p, 1
neo.strip 0, led, col, 0
led = led + 1
if (led > 15) then
led = 0
col_p = col
col = rnd(256 * 256 * 256)
endif
endif
return
'-------------------------------------------------------------------
printtime:
'-------------------------------------------------------------------
D1$=date$
D2$=replace$(date$,"/",".")
T1$=time$
T2$=word$(time$,1,":") & ":" & word$(time$,2,":")
T3$=left$(time$,5)
print D1$, D2$, T1$, T2$, T3$
wlog D1$, D2$, T1$, T2$, T3$
oled.cls
oled.print 0, 0, "Date:" + D2$
'oled.print 0, 16, "Time:" + T1$
oled.print 0, 16, "Time:" + T2$
'oled.print 0, 16, "Time:" + T3$
oled.print 0, 48, "ADC:" + str$(adc(34))
oled.refresh 0
return
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
matrix1:V+
matrix1:GND
matrix1:DIN
matrix1:CS
matrix1:CLK
matrix1:V+.2
matrix1:GND.2
matrix1:DOUT
matrix1:CS.2
matrix1:CLK.2
ring1:GND
ring1:VCC
ring1:DIN
ring1:DOUT
oled1:GND
oled1:VCC
oled1:SCL
oled1:SDA
pot1:VCC
pot1:SIG
pot1:GND
ring2:GND
ring2:VCC
ring2:DIN
ring2:DOUT