The docs have been updated.
http://esp8266basic.com
A BASIC interpreter for your ESP
Working now on Autodrop3d. A 3d printer with automatic part ejection system. https://autodrop3d.com
Explore... Chat... Share...
Moderator: Mmiscool
memclear
cls
spi.setup(1000000, 0)
gosub [init.expander]
for i = 0 to 255
' write port A
add = 18
dat = (not i)
gosub [write_exp]
gosub [write_595]
'read port B
add = 19
gosub [read_exp]
serialprintln dat
next i
end
''''''''''''''''''''''''''''''''''''
' INIT THE MCP27S17 EXPANDER
''''''''''''''''''''''''''''''''''''
[init.expander]
'disable HAEN (Hardware Address Enable)
add = 12 ' IOCON
dat = 0 ' disable HAEN
gosub [write_exp]
'set the expander with port A output
add = 0 'IODIRA
dat = 0 ' all outputs
gosub [write_exp]
'set the expander with port B input
add = 1 'IODIRB
dat = 255 ' all inputs
gosub [write_exp]
'set the expander with pull-up on port B inputs
add = 13 'GPPUB
dat = 255 ' all inputs pullup active
gosub [write_exp]
return
''''''''''''''''''''''''''''''''''''
' WRITE to the MCP23S17 EXPANDER
' this function uses the variables
' add = address - INPUT -
' dat = data - INPUT -
'''''''''''''''''''''''''''''''''''
[write_exp]
'chip select
po 5 0
spi.byte(64) 'writemode (0x40)
spi.byte(add)
spi.byte(dat)
po 5 1
return
''''''''''''''''''''''''''''''''''''
' READ from the MCP23S17 EXPANDER
' this function uses the variables
' add = address - INPUT -
' dat = data - OUTPUT -
'''''''''''''''''''''''''''''''''''
[read_exp]
'chip select
po 5 0
spi.byte(65) 'readmode (0x41)
spi.byte(add)
dat = spi.byte(dat)
po 5 1
return
''''''''''''''''''''''''''''''''''''
' WRITE to the 74HC595 shift register
' this function uses the variables
' dat = data - INPUT -
'''''''''''''''''''''''''''''''''''
[write_595]
'chip select
spi.byte(dat)
po 2 0
po 2 1
return
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]