This is the program:
Code: [Local Link Removed for Guests]
' For ESP8266 Wemos D1 Mini
' GPIO0=D3 : GPIO1=TX : GPIO2=D4 : GPIO3=RX : GPIO4=D2 : GPIO5=D1
' GPIO12=D6 : GPIO13=D7 : GPIO14=D5 : GPIO15=D8 : GPIO16=D0
' DECLARE SUB display(w, l)
' Turns on or off the corresponding bit of the decimal value w for a width of l bits.
' DECLARE SUB dec_bin(w, l)
' Display decimal value w in binary format, adding leading zeros until full width l.
dim led(9) = 0, 1, 2, 3, 4, 5, 12, 13, 14, 15
' Declares all 10 pins as output and sets them to zero
for n = 0 to 9
pin.mode led(n), output
pin(n) = 0
next n
pause 5000
t= 80 ' scroll speed in milliseconds
' DOT SCROLL:
for n = 0 to 10
w = 2^(n-1)
display w, 10
dec_bin w, 10
pause t
next n
for n = 10 to 0 step -1
w = 2^(n-1)
display w, 10
dec_bin w, 10
pause t
next n
pause 500
'BAR SCROLL:
for n = 0 to 10
w = (2^n)-1
display w, 10
dec_bin w, 10
pause t
next n
pause 200
for n = 10 to 0 step -1
w = (2^n)-1
display w, 10
dec_bin w, 10
pause t
next n
pause 500
' Opening and closing bar:
dim patern(5) = 0, 513, 771, 903, 975, 1023
for n = 1 to 3
for i = 0 to 5
w = patern(i)
display w, 10
pause t
next i
for i = 5 to 0 step -1
w = patern(i)
display w, 10
pause t
next i
next n
pause 500
' BINARY COUNTER:
for w = 0 to 1023
display w, 10
dec_bin w, 10
pause 50
next w
display 0, 10
END
' ---------------
SUB display(w, l)
LOCAL bit
for bit = 0 to l-1
if (w and (1 << bit)) <> 0 then pin(led(bit))=1 else pin(led(bit))=0
next bit
END SUB
' ---------------
SUB dec_bin(w, l)
LOCAL b$
b$ = bin$(w)
b$ = string$(l-len(b$), "0") + b$
wlog b$
END SUB
And this is the video:
https://youtube.com/shorts/9CxZwJHE0O0?feature=share
But my goal is to ask you for help on a question. If I replace the "normal" GPIO control instructions with what I thought were equivalent for BAS.POKE, I have a problem.
Code: [Local Link Removed for Guests]
DIR_OUTPUT = &H60000310
GPIO_OUT = &H60000300
'PIN_IN = &H60000318
'GPIO_SET = &H60000304
'GPIO_ENABLE = &H6000030C
t = 1500
BAS.POKE8 DIR_OUTPUT, &B00001111
bas.poke8 GPIO_OUT, &B0000
pause t
bas.poke8 GPIO_OUT, &B0001
pause t
bas.poke8 GPIO_OUT, &B0010
pause t
bas.poke8 GPIO_OUT, &B0011
pause t
bas.poke8 GPIO_OUT, &B0100
pause t
bas.poke8 GPIO_OUT, &B0101
pause t
bas.poke8 GPIO_OUT, &B0110
pause t
bas.poke8 GPIO_OUT, &B0111
pause t
bas.poke8 GPIO_OUT, &B1000
pause t
bas.poke8 GPIO_OUT, &B1001 ' Fail
pause t
bas.poke8 GPIO_OUT, &B1010
pause t
bas.poke8 GPIO_OUT, &B1011 ' Fail
pause t
bas.poke8 GPIO_OUT, &B1100
pause t
bas.poke8 GPIO_OUT, &B1101 ' Fail
pause t
bas.poke8 GPIO_OUT, &B1110
pause t
bas.poke8 GPIO_OUT, &B1111 ' Fail
pause t
bas.poke8 GPIO_OUT, &B0001 ' Ok
pause t
END
LED 1 does not light up from line 30 of this program:
https://youtube.com/shorts/WDUk2gRwEXw?feature=share
Please, what am I doing wrong?