RTduino Source Code Reference Manual
|
Advanced input and output functions. More...
Functions | |
unsigned long | pulseIn (uint8_t pin, uint8_t state, unsigned long timeout) |
Measures the duration of a pulse (in us) on the specified pin. More... | |
unsigned long | pulseInLong (uint8_t pin, uint8_t state, unsigned long timeout) |
Measures the duration of a pulse (in us) on the specified pin. More... | |
void | shiftOut (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) |
Sends out a byte of data on the specified data pin using the specified clock and bit order. More... | |
uint8_t | shiftIn (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) |
Shifts in data on a specified data pin using a specified clock pin and bit order. More... | |
Advanced input and output functions.
unsigned long pulseIn | ( | uint8_t | pin, |
uint8_t | state, | ||
unsigned long | timeout | ||
) |
Measures the duration of a pulse (in us) on the specified pin.
/
The state parameter specifies the type of pulse to measure (HIGH or LOW). The timeout parameter specifies the maximum time to wait for the pulse to complete. This function works on pulses from 2-3 microseconds to 3 minutes in length. It cannot work in noInterrupt() context.
pin | The pin number to measure the pulse on. |
state | The type of pulse to measure (HIGH or LOW). |
timeout | The maximum time to wait for the pulse to complete, in microseconds. |
unsigned long pulseInLong | ( | uint8_t | pin, |
uint8_t | state, | ||
unsigned long | timeout | ||
) |
Measures the duration of a pulse (in us) on the specified pin.
/
The state parameter specifies the type of pulse to measure (HIGH or LOW). The timeout parameter specifies the maximum time to wait for the pulse to complete. This function works on pulses from 2-3 microseconds to 3 minutes in length. It relies on the micros() function, so it cannot be used in noInterrupt() context.
pin | The pin number to measure the pulse on. |
state | The type of pulse to measure (HIGH or LOW). |
timeout | The maximum time to wait for the pulse to complete, in microseconds. |
uint8_t shiftIn | ( | uint8_t | dataPin, |
uint8_t | clockPin, | ||
uint8_t | bitOrder | ||
) |
Shifts in data on a specified data pin using a specified clock pin and bit order.
/
dataPin | The pin on which to read the incoming data. |
clockPin | The pin to toggle to signal the sending device that the Arduino is ready to receive the next bit. |
bitOrder | The order in which to receive the bits (LSBFIRST or MSBFIRST). |
void shiftOut | ( | uint8_t | dataPin, |
uint8_t | clockPin, | ||
uint8_t | bitOrder, | ||
uint8_t | val | ||
) |
Sends out a byte of data on the specified data pin using the specified clock and bit order.
/
dataPin | The pin on which to output the data. |
clockPin | The pin to toggle to signal the receiving device that the data is ready. |
bitOrder | The order in which to send the bits (LSBFIRST or MSBFIRST). |
val | The data byte to send. |