Introduction
SiB™ vs SID mode
Programs in SiB™ mode
Programs in SID mode
Sample Programs
- Door Bell - Emergency Button - Freezer Monitor - I Love You - Lights Demo - Magnetic Alarm - Motion Sensor - Sweet Dreams - Thermometer - Water/Moisture Sensor - Yes or No
Commands
A - Z Configuration GPIO Programming Time Sensor Messaging
| BUTTON
This function allows a long-running SiD or SiB program to monitor and take actions when a button press is detected. The first parameter is the letter S (for short click) or L (for long click). The second parameter is a function name. After this command is issued in a PROG, the SiB, until the next power cycle, will monitor the button for presses. When a button press is detected, the SiB will call the appropriate function.BUTTON
Usage: BUTTON S|L functionName
This function allows a long-running SiD or SiB program to monitor and take actions when a button press is detected. The first parameter is the letter S (for short click) or L (for long click). The second parameter is a function name. After this command is issued in a PROG, the SiB, until the next power cycle, will monitor the button for presses. When a button press is detected, the SiB will call the appropriate function.
NOTE that if you are already running a function, that function will be interrupted for the button-press function and will NOT return.
If a short (s) function is setup but not a long (l) function, the short function will be called for presses of any length.
A short and long function can be added in the same running program by calling the BUTTON function twice.
DRIVE
Sets the maximum drive capability of a given GPIO. The default value is 2.DRIVE
Usage: DRIVE gpio 0-3
Sets the maximum drive capability of a given GPIO. The default value is 2.
FL
This command returns a GPIO to floating.FL
Usage: FL gpio
This command returns a GPIO to floating.
This command will return a given GPIO to floating.
See also: HOLD, WD, WA
FREQ
This command pulses a square frequency on any given pin, for the specified duration.FREQ
Usage: FREQ pin frequency duration
This command pulses a square frequency on any given pin, for the specified duration.
The frequency parameter is given in HZ, and the duration is given in milliseconds.
The duration paremeter accepts the suffixes s = seconds, m = minutes, h = hours.
For example: FREQ 8 200 1m
See also: WA
HOLD
This function holds a pin output to high or low even during deep sleep.HOLD
Usage: HOLD pin 0|1
This function holds a pin output to high or low even during deep sleep.
NOTICE: This command will briefly reset the state of the GPIO and render it floating.
This function only works on RTC pins. An error will be returned if an invalid pin is given.
Specify 1 for HIGH, and 0 for LOW.
When deep sleep ends, the HOLD value is lost and the PIN will reset to its default state.
HOLD+
If you wish to carry a held value after a reset or deep sleep, issue HOLD+ instead of HOLD.
HOLD+ may only be used on RTC GPIOs.
See also: FL
RA
Reads an analog value from a given pin into the given variable.RA
Usage: RA pin variable
Reads an analog value from a given pin into the given variable.
This function is only available on some specific pins. Entering a wrong pin will result in an error.
This function returns a value between 0 and 1024. The value is stored in the given variable.
For example:
RA 15 pin_15
will store the analog input from pin 15 at that specific time into a variable named pin_15
See also: WD, WA, HOLD, RD, FL
RAX
Reads a raw voltage value in MV from a given gpio into the given variable.RAX
Usage: RAX pin variable
Reads a raw voltage value in MV from a given gpio into the given variable.
This function reads an uncalibrated (raw) voltage reading from an ADC-enabled RTC GPIO.
If a GPIO from ADC2 is requested, this function must be used in PREW only. This function will return a maximum of approximately 3060, for 3V.
See also: RV
RD
Reads a digital value from a given pin into the given variable.RD
Usage: RD pin variable
Reads a digital value from a given pin into the given variable.
This function returns either 0 for low, and 1 for high current. The value is stored in the given variable.
For example:
RD 15 pin_15
will store the digital input from pin 15 at that specific time into a variable named pin_15
See also: WD, WA, RA, RAX, FL, HOLD
RDH
Reads a digital value from a pin with a pull-up function.RDH
Usage: RDH pin variable
Reads a digital value from a pin with a pull-up function.
This function reads a digital 0 or 1 from the specified pin into a variable. If the pin is floating, a value of 1 (high) will be stored.
RDL
Reads a digital value from a pin with a pull-down function.RDL
Usage: RDL pin variable
Reads a digital value from a pin with a pull-down function.
This function reads a digital 0 or 1 from the specified pin into a variable. If the pin is floating, a value of 0 (low) will be stored.
RV
This function reads the voltage level of the power source attached to GPIO 35.RV
Usage: RV [variable]
This function reads the voltage level of the power source attached to GPIO 35.
This function should only be called after executing CALIB POWER.
If a variable is given, the result in millivolts will be stored. Otherwise, an IM will be sent.
See also: CALIB POWER, RAX
WA
Outputs a pulse wave to the specified pin. WA
Usage: WA pin 0-1024
Outputs a pulse wave to the specified pin.
The accepted range is from 0% to 100%. This function can be used to toggle a LED brightness or buzzer tone. For a more precise square wave, use the FREQ command.
Both the GPIO # and the value can be represented by variables.
See also: RA, WD, WA, HOLD, FL
WAKEIO
Goes to sleep until a specific GPIO event is triggered.WAKEIO
Usage: WAKEIO gpio 1|0 timeout
Goes to sleep until a specific GPIO event is triggered.
This command will put the SiB™ to sleep until the specified GPIO reads the target level HIGH (1) or LOW (0).
When specifying a HIGH value, the sleep can also be interrupted by button press. When specifying a LOW value, the sleep will not be interrupted by button press.
The timeout value is optional. Specify a timeout (i.e., 20s, 10ms, 1h) to have the sleep end without the GPIO level being reached.
At the moment, there is no way to differentiate between a wake on timeout and a wake on IO
WD
Outputs High (1) or Low (1) to the specified pin.WD
Usage: WD pin 0|1
Outputs High (1) or Low (1) to the specified pin.
Both the GPIO # and the value can be represented by variables.
See also: WA, RA, FL, HOLD, RD
|