Monitors other pin(s) or public data in the Serial Wombat chip and generates a pin pulse on change.
More...
|
| SerialWombatPulseOnChange (SerialWombatChip &serialWombat) |
| Class constructor for SerialWombatPulseOnChange. More...
|
|
int16_t | begin (uint8_t pin, SerialWombatPinState_t activeMode=SW_HIGH, SerialWombatPinState_t inactiveMode=SW_LOW, uint16_t pulseOnTime=50, uint16_t pulseOffTime=50, uint8_t orNotAnd=1, uint16_t PWMperiod=0, uint16_t PWMdutyCycle=0x8000) |
| Initialization routine for SerialWombatPulseOnChange. More...
|
|
int16_t | setEntryOnChange (uint8_t entryID, uint8_t sourcePin) |
| Configure a change entry to pulse when a pin or public data changes. More...
|
|
int16_t | setEntryOnIncrease (uint8_t entryID, uint8_t sourcePin) |
| Configure a change entry to pulse when a pin or public data increases. More...
|
|
int16_t | setEntryOnDecrease (uint8_t entryID, uint8_t sourcePin) |
| Configure a change entry to pulse when a pin or public data Decreases. More...
|
|
int16_t | setEntryOnEqualValue (uint8_t entryID, uint8_t sourcePin, uint16_t value) |
| Configure a change entry to pulse when a pin or public data equals a specified value. More...
|
|
int16_t | setEntryOnLessThanValue (uint8_t entryID, uint8_t sourcePin, uint16_t value) |
| Configure a change entry to pulse when a pin or public data is below a specified value. More...
|
|
int16_t | setEntryOnGreaterThanValue (uint8_t entryID, uint8_t sourcePin, uint16_t value) |
| Configure a change entry to pulse when a pin or public data is above a specified value. More...
|
|
int16_t | setEntryOnNotEqualValue (uint8_t entryID, uint8_t sourcePin, uint16_t value) |
| Configure a change entry to pulse when a pin or public data is not equal to a specified value. More...
|
|
int16_t | setEntryOnPinsEqual (uint8_t entryID, uint8_t sourcePin, uint8_t secondPin) |
| Configure a change entry to pulse when a pin or public data equals a second pin or public data's value. More...
|
|
int16_t | setEntryOnPinsNotEqual (uint8_t entryID, uint8_t sourcePin, uint8_t secondPin) |
| Configure a change entry to pulse when a pin or public data is not equal to a second pin or public data's value. More...
|
|
| SerialWombatPin (SerialWombatChip &serialWombatChip) |
| Instantiates a Serial Wombat Pin. More...
|
|
| SerialWombatPin (SerialWombatChip &serialWombatChip, uint8_t pin) |
| Instantiates a Serial Wombat Pin. More...
|
|
uint16_t | readPublicData () |
| Read the 16 Bit public data associated with this pin. More...
|
|
void | pinMode (uint8_t mode) |
| Set pin to INPUT or OUTPUT. More...
|
|
void | pinMode (uint8_t mode, bool pullDown, bool openDrain) |
| Set pin to INPUT or OUTPUT, with options for pull Ups and open Drain settings. More...
|
|
void | digitalWrite (uint8_t val) |
| Set output pin High or Low. More...
|
|
int | digitalRead () |
| Reads the state of the Pin. More...
|
|
uint16_t | writePublicData (uint16_t value) |
| Write a 16 bit value to this pin. More...
|
|
uint8_t | pin () |
| Returns the current SW pin number. Used primarily for virtual calls by derived classes. More...
|
|
uint8_t | swPinModeNumber () |
| Returns the Mode number. Used primarily by derived classes to populate packet data. More...
|
|
Monitors other pin(s) or public data in the Serial Wombat chip and generates a pin pulse on change.
This class controls the Pulse on Change pin mode of the Serial Wombat Chip. Pulse on Change is useful to generate a pulse that can drive an interrupt on the host Arduino, or for creating user alerts such as LED pulses or buzzer tones that acknowledge data reception or human input.
For instance, a pulse could be generated when the output value of a rotary encoder state machine on other pins changes value. Or an LED could be pulsed to command traffic on the Serial Wombat chip by making it pulse when SW_DATA_SOURCE_PACKETS_RECEIVED changes.
Reference the Public Data and Pin Modes section on the main page to learn more about public data and how public data on the Serial Wombat chip works.
The each pin can monitor up to 8 other pins or data sources for changes. A pulse will be generated when any of the criteria (orNotAnd == 1) or all (simultaneously) of the criteria (orNotAnd == 0) are met. Criteria can be any of the following:
- Pin data or public data changed
- Pin data or public data increased
- Pin data or public data decreased
- Pin data or public data equals a fixed value
- Pin data or public data below a fixed value
- Pin data or public data above a fixed value
- Pin data or public data not equal to a fixed value
- Pin data or public data crosses a fixed value
- Pin data or public data crosses (ascending) a fixed value
- Pin data or public data crosses (descending) a fixed value
- Pin data or public data equals another pin
- Pin data or public data below another pin
- Pin data or public data above another pin
- Pin data or public data not equal to another pin
- Pin data or public data is within a range
- Pin data or public data is outside a range
A video Tutorial on this pin mode is available:
TODO
TODO https://youtu.be/