Statistics: Posted by Majo — Sat Jan 15, 2022 5:03 pm
'/LCD_TEMP.bas/2021.02.10.
'DS28B20/DAT-->D1mini/D4/GPIO2
'LCD/SDA-->D1mini/D2/GPIO4
'LCD/SCL-->D1mini/D1/GPIO5
wifi.connect
memclear
cls
delay 300
time.setup(1) 'Hungarian Time
'---initialization--------------------------
let address = 39 'PCF8574 I2C Address
i2c.setup(4,5) 'choose your I2C bus pins
lcdsend 2,0 '2=four_bits, command
'------------------------------------------------
wprint "Temp(C)="
textbox hom
wprint "<br>"
wprint "Date/Time="
textbox t_d
wprint "<br>"
button "Exit", [quit]
timer 2000, [refresh]
wait
[refresh]
'delay 100
t_d = time("month day. hour:min:sec")
delay 100
hom = int(temp(0)*10)/10
lcdcls
lcdprint "Temp=" & hom & " C",2,0
x = 0 'pos(0...16)
y = 1 'line(0...1)
lcdprint t_d,x,y 'x=0...16(pos); y=0 or 1(line)
wait
[quit]
end
Statistics: Posted by mezjoc — Wed Feb 10, 2021 12:44 pm
'/LCD COMMADS_1.bas/2021.02.08
memclear
cls
'HD44780-initialization !!!
wprint "Temp(C)="
'hom = int(temp(0)*10)/10
textbox hom
wprint "<br>"
button "Exit", [quit]
timer 3000, [refresh]
wait
[refresh]
hom = int(temp(0)*10)/10
thom = hom*10
egesz$ = asc(chr(thom/10))
tized = thom - int(thom/10)*10
tized$ = asc(chr(tized))
lcdcls
lcdprint "Temp=" & egesz$ & "." & tized$ & " C",0,0
x = 0 'pos(0...16)
y = 1 'sor(0...1)
'lcdprint "<-Second line->",x,y 'x=0...16(pos); y=0...1(sor)
wait
[quit]
end
Statistics: Posted by mezjoc — Mon Feb 08, 2021 11:54 am
'/I2C LCD Init 4-bit.bas/2021.02.04.
wifi.connect
memclear
cls
let address = 39 'PCF8574 I2C Address
i2c.setup(4,5) 'choose your I2C bus pins
a$ = "Temp="
hom = int(temp(0)*10)/10
b$ = str(hom)
c$ = " C"
text$ = a$ & b$ & c$ 'text$ = "Hello World"
'P7 P6 P5 P4 P3 P2 P1 P0 --- PCF8574
' | | | | | | | |
'D7 D6 D5 D4 Bl EN R/W RS --- HD44780
[Initialization]
delay 150 'step1
i2c.begin(address)
i2c.write(52) '0011 0100b=52 'step2
i2c.write(0)
delay 5
i2c.write(52) '0011 0100b=52 'step3
i2c.write(0)
delay 1
i2c.write(52) '0011 0100b=52 'step4
i2c.write(0)
delay 1
i2c.write(36) '0010 0100b=36 'step5
i2c.write(0)
delay 1
i2c.write(36) '0010 0100b=36 'step6
i2c.write(0)
i2c.write(132) '1000 0100b=132
i2c.write(0)
delay 1
i2c.write(4) '0000 0100b=4 'step7
i2c.write(0)
i2c.write(132) '1000 0100b=132
i2c.write(0)
delay 1
i2c.write(4) '0000 0100b=4 'step8
i2c.write(0)
i2c.write(20) '0001 0100b=20
i2c.write(0)
delay 5
i2c.write(4) '0000 0100b=4 'step9
i2c.write(0)
i2c.write(100) '0110 0100b=100 '0 1 I/D S
i2c.write(0) 'I/D=1-->Increment by 1
i2c.end() 'S=0-->No shift
delay 1
'Initialization ends 'step10
i2c.begin(address) 'step11
i2c.write(4) '0000 0100b=4
i2c.write(0)
i2c.write(196) '1100 0100b=196 '1 1 C B
i2c.write(0) 'C=0-->Cursor off
i2c.end() 'B=0-->Blinking off
delay 100
'Display:
print "Specified string(text$):"
print text$
print "The number of characters in the string:"
print len(text$)
print
for n = 1 to len(text$)
i2c.begin(address)
i2c.write((asc(mid(text$,n,1)) and 240) + 13)
i2c.write(0)
i2c.write((asc(mid(text$,n,1)) and 15) << 4 + 13)
i2c.write(0)
i2c.end()
next n
i2c.begin(address)
i2c.write(8) '0000 1000=Blacklight:On
i2c.end()
button "EXIT",[quit]
wait
[quit]
end
Statistics: Posted by mezjoc — Sat Feb 06, 2021 3:00 pm
Statistics: Posted by schufti — Sat Feb 06, 2021 5:33 am
Statistics: Posted by mezjoc — Fri Feb 05, 2021 5:00 pm
Statistics: Posted by mezjoc — Fri Feb 05, 2021 4:51 pm
Statistics: Posted by mezjoc — Sat Jan 30, 2021 3:30 pm
Statistics: Posted by mezjoc — Fri Jan 15, 2021 4:42 pm
Statistics: Posted by mezjoc — Thu Jan 14, 2021 7:39 am
[received]
ircode1 = ir.recv.get()
if ircode1<>"ffffffff" then ircode=ircode1
return
Statistics: Posted by Vadim K — Fri Apr 17, 2020 4:11 am
Statistics: Posted by rudy — Wed Mar 11, 2020 9:54 pm
Statistics: Posted by Juweh — Wed Mar 11, 2020 12:11 am
Statistics: Posted by Juweh — Wed Mar 11, 2020 12:09 am
Statistics: Posted by rudy — Mon Mar 09, 2020 7:15 pm
Statistics: Posted by AcmeUK — Mon Mar 09, 2020 8:15 am
Statistics: Posted by Juweh — Sun Mar 08, 2020 4:29 am
Statistics: Posted by Luc Volders — Fri Feb 07, 2020 10:30 am
Statistics: Posted by Luc Volders — Sun Dec 15, 2019 11:37 am
Statistics: Posted by niroantonio — Sun Jul 21, 2019 3:30 am
Statistics: Posted by scafesso — Mon May 27, 2019 6:33 am
Statistics: Posted by Roshan — Fri May 24, 2019 8:34 am
Statistics: Posted by Luc Volders — Fri Mar 22, 2019 3:20 pm
[DoItAgain]
cls
run
wait
Statistics: Posted by MegaHurtz — Mon Mar 18, 2019 5:41 am
Statistics: Posted by Luc Volders — Fri Mar 15, 2019 3:09 pm
Statistics: Posted by Luc Volders — Fri Mar 08, 2019 3:02 pm
Statistics: Posted by mcguinn — Mon Feb 25, 2019 5:18 pm
Statistics: Posted by Carlitos007 — Tue Feb 05, 2019 10:48 am