Implementation of the Arduino API in RIOT.
More...
Implementation of the Arduino API in RIOT.
|
typedef bool | boolean |
| Arduino boolean data type definion.
|
|
typedef uint8_t | byte |
| Arduino byte data type definion.
|
|
|
void | pinMode (int pin, int mode) |
| Configure a pin as either input or output. More...
|
|
void | digitalWrite (int pin, int state) |
| Set the value for the given pin. More...
|
|
int | digitalRead (int pin) |
| Read the current state of the given pin. More...
|
|
void | delay (unsigned long msec) |
| Sleep for a given amount of time [milliseconds]. More...
|
|
void | delayMicroseconds (unsigned long usec) |
| Sleep for a given amount of time [microseconds]. More...
|
|
unsigned long | micros () |
| Returns the number of microseconds since start. More...
|
|
unsigned long | millis () |
| Returns the number of milliseconds since start. More...
|
|
int | analogRead (int pin) |
| Read the current value of the given analog pin. More...
|
|
void | analogWrite (int pin, int value) |
| Write an analog value to a pin. More...
|
|
◆ ARDUINO_PWM_FREQU
#define ARDUINO_PWM_FREQU (1000U) |
◆ anonymous enum
Possible pin configurations.
Enumerator |
---|
INPUT | configure pin as input
|
OUTPUT | configure pin as output
|
INPUT_PULLUP | configure pin as input with pull-up resistor
|
Definition at line 45 of file arduino.hpp.
◆ anonymous enum
Possible pin states.
Enumerator |
---|
LOW | pin is cleared
|
HIGH | pin is set
|
Definition at line 54 of file arduino.hpp.
◆ analogRead()
int analogRead |
( |
int |
pin | ) |
|
Read the current value of the given analog pin.
- Parameters
-
- Returns
- a value between 0 to 1023 that is proportionnal to the voltage applied to the pin
◆ analogWrite()
void analogWrite |
( |
int |
pin, |
|
|
int |
value |
|
) |
| |
Write an analog value to a pin.
- Parameters
-
[in] | pin | pin to write |
[in] | value | duty cycle value, between 0 and 255 |
◆ delay()
void delay |
( |
unsigned long |
msec | ) |
|
Sleep for a given amount of time [milliseconds].
- Parameters
-
[in] | msec | number of milliseconds to sleep |
◆ delayMicroseconds()
void delayMicroseconds |
( |
unsigned long |
usec | ) |
|
Sleep for a given amount of time [microseconds].
- Parameters
-
[in] | usec | number of microseconds to sleep |
◆ digitalRead()
int digitalRead |
( |
int |
pin | ) |
|
Read the current state of the given pin.
- Parameters
-
- Returns
- state of the given pin, HIGH or LOW
◆ digitalWrite()
void digitalWrite |
( |
int |
pin, |
|
|
int |
state |
|
) |
| |
Set the value for the given pin.
- Parameters
-
[in] | pin | pin to set |
[in] | state | HIGH or LOW |
◆ micros()
Returns the number of microseconds since start.
- Returns
- value of microseconds since start
◆ millis()
Returns the number of milliseconds since start.
- Returns
- value of milliseconds since start
◆ pinMode()
void pinMode |
( |
int |
pin, |
|
|
int |
mode |
|
) |
| |
Configure a pin as either input or output.
- Parameters
-
[in] | pin | pin to configure |
[in] | mode | mode to set the pin to |