Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update API
authored
Apr 19, 2019
by
Vince Mulhollon
Show whitespace changes
Inline
Side-by-side
API.md
View page @
ead8f76e
...
...
@@ -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