Skip to content
Update API authored by Vince Mulhollon's avatar Vince Mulhollon
......@@ -15,25 +15,50 @@ Example:
Would set pin PA10 to input mode with an internal pullup resistor
## seesaw:digital-read-p
Reads a bit from GPIO returning a T or NIL. Note, you should set the pin direction to input, before reading. Example:
Reads a bit from GPIO returning a T or NIL. Note, you should set the pin direction to input, before reading. Parameters:
<pre>
(seesaw:digital-read-p pin)
</pre>
Example:
<pre>
(seesaw:digital-read-p 'PA10)
</pre>
Would read pin PA10 and if logical high "1" would return T, otherwise return nil..
## seesaw:id-read
Read the hardware ID of the chip, which should always be 0x55 aka 85 decimal. Example:
Read the hardware ID of the chip, which should always be 0x55 aka 85 decimal. Parameters:
<pre>
(seesaw:id-read)
</pre>
Example:
<pre>
(seesaw:id-read)
</pre>
Would return #x55, REPL will display that as 85 decimal. Essentially a NOP "ping" of the device.
## seesaw:reset
Software reset the seesaw chip. Example:
Software reset the seesaw chip. Parameters:
<pre>
(seesaw:reset)
</pre>
Example:
<pre>
(seesaw:reset)
</pre>
Would software reset the seesaw device.
## seesaw:pwm
Set a pin to output a PWM signal. Percentages have convenience quotes. Example, to set an Adafruit (tm) TFTv2 backlight to half brightness:
Set a pin to output a PWM signal.
Percentages have convenience quotes.
'on and 'full translate to 100 percent.
'half translates to 50 percent.
'off translates to 0 percent.
Parameters:
<pre>
(seesaw:pwm pin 'percent)
</pre>
Example:
<pre>
(seesaw:pwm 'PA04 'half)
</pre>
Would set an Adafruit (tm) TFTv2 backlight to half brightness