- Tue Feb 19, 2019 3:05 pm
#80664
For setting I/O's use the "im" command.
im without arguments lists all I/O's, this may be more than can fit in the buffer (4096 bytes) so it may be truncated. Use im with an index (like im 0) to get all pins from I/O 0 (gpio) only.
To set an I/O use im with arguments:
im <i/o> <pin> <mode> <extra...>
Where <i/o> = 0 for the internal GPIO, 1 for some extra internal GPIO I/O's (RTC and ADC), 2-5 are optionally connected i2c I/O expanders and 6 is an optionally connected ledpixel string.
<pin> is the pin number
<extra...> depends on the pin mode
- use "disabled" to disable a pin (set it to highZ)
- use "dinput" for a digital input
- use "counter" to create a counter
- use "timer" to create a timer (periodically on/off)
- use "ainput" to create an analog input (works only on io 1, pin 1)
- use "pwm" to create a quasi-analog output with PWM (8-18 bits wide)
- use "i2c" to create i2c I/O's (SDA, SCL)
- use "uart" to define UART communication on a pin (works only on io 0, pin 1,2,3)
- use "lcd" to define a hitachi-style LCD
- use "trigger" to define a trigger (port is set to input, when it's activated, perform an action)
- use "ledpixel" to define a port to be used for led pixels (output) (the individual led pixels are configured on I/O 6)
- use "pwm2" to define an alternative PWM, using built-in PDM, which is only 8 bits wide but very high refresh.
If you don't know what's the syntax, type e.g. "im 0 0 pwm" and you will be told what to add.
There is also a "help" command.
Hope this will get you started, don't hesitate to ask.