https://github.com/MitchBradley/cforth.git
PRG-esp32
git clone https://github.com/MitchBradley/cforth.git
cd ./cforth/build/esp32
make
COMPORT=/dev/ttyUSB0 make flash
ok : HELLOW ( -- ) CR ." Hello, world!" ;
ok HELLOW
ok : emit-star ( the ASCII value for the character '*' ) 2a EMIT ;
コマンド |
gpio-is-input-pulldown |
gpio-is-input-pullup |
gpio-is-input |
gpio-is-output-open-drain |
gpio-is-output |
gpio-toggle |
gpio-pin! |
gpio-pin@ |
ok 2 gpio-is-output
ok 0 2 gpio-pin!
ok 1 2 gpio-pin!
# BPI-BIT
ok decimal
ok 18 gpio-is-output
ok 0 18 gpio-pin!
ok 1 18 gpio-pin!
ok decimal
ok 35 gpio-is-input
ok 35 gpio-pin@
|
|
hall@ |
|
adc@ |
|
adc-atten! |
|
adc-width! |
|
ok 2 adc-width! \ set 11 bit precision
ok 2 6 adc-atten! \ set ADC1_CH6 :: 2 is for 6dB attenuation - range from 0 - 1.8V
ok 6 adc@ \ get adc
ok .
327
ok
ok 2 adc-width! \ 11 bit precision
ok 2 0 adc-atten! \ ADC1_CH0 :: 2 is for 6dB attenuation - range from 0 - 1.8V
ok 2 3 adc-atten! \ ADC1_CH3 :: 2 is for 6dB attenuation - range from 0 - 1.8V
ok 0 adc@
ok 3 adc@