Closed mitra42 closed 3 years ago
From https://arduino-forth.com/article/FORTH_FlashForth_pinsDefinition
defPIN ( PORTx mask --
From WiringPi: https://github.com/kristopherjohnson/wiringPi_gforth 18 CONSTANT LEDpin LEDpin OUTPUT pinMode LEDpin HIGH digitalWrite See also https://github.com/kristopherjohnson/wiringPi_gforth/blob/master/wiringPi.fs (more specific to Pi)
Note ESP8266 tests performed on Lolin D1 mini pro (like Wemos) and Arduino on Arduino UNO Arduino C functions are documented in https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode/ mode = INPUT | OUTPUT | INPUT_PULLUP INPUT=0 OUTPUT=1 INPUT_PULLUP=2 on Arduino & ESP8266 pinMode(pin, mode) digitalWrite(13, HIGH);
Also: https://www.arduino.cc/en/Tutorial/Foundations/DigitalPins. summary:
Also: https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/ val = AnalogRead(pin) ; range 0..1023
Also https://randomnerdtutorials.com/esp8266-adc-reading-analog-values-with-nodemcu/ which suggests only Analog pin on ESP8266 is A0
See https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
Most of the ESP8266 development boards have a built-in LED. This LED is usually connected to GPIO2 = D4 On Lolin board BUILTIN_LED is defined as 2
Straw-person steps
Closing as split subtasks into own issues:
See Analog input #101 See Analog write #102 See Interrupts #103
Add some words to manage pins.
Some examples of other approaches