#include <stdint.h>
Go to the source code of this file.
|
| #define | INPUT 0 |
| | Pin mode input, high Z.
|
| |
| #define | OUTPUT 1 |
| | Pin mode output.
|
| |
| #define | LOW 0 |
| | Output state low.
|
| |
| #define | HIGH 1 |
| | Output state high.
|
| |
| #define | DBG(...) |
| | Print a formatted message to the console in DEBUG mode.
|
| |
| #define | interrupts() __asm__("cli") |
| | Enables maskable interrupts.
|
| |
| #define | noInterrupts() __asm__("sei") |
| | Disables maskable interrupts.
|
| |
|
| void | delay (uint32_t milliseconds) |
| | Stops execution for the given amount of milliseconds.
|
| |
| void | analogWrite (uint8_t pin, uint8_t level) |
| | Sets the output level for an analog pin using Pulse Width Modulation (PWM).
|
| |
| uint8_t | digitalRead (uint8_t pin) |
| | Reads state of an input pin.
|
| |
| void | digitalWrite (uint8_t pin, uint8_t state) |
| | Sets state of an output pin.
|
| |
| void | noTone (uint8_t pin) |
| | Stops tone output.
|
| |
| void | pinMode (uint8_t pin, uint8_t mode) |
| | Sets mode of a pin.
|
| |
| void | tone (uint8_t pin, uint16_t frequency) |
| | Outputs a square wave with the given frequency in the range 10Hz..65kHz.
|
| |
| void | setup (void) |
| | Called once before loop().
|
| |
| void | loop (void) |
| | Called repeatedly after setup().
|
| |
◆ DBG
Print a formatted message to the console in DEBUG mode.
◆ HIGH
◆ INPUT
◆ interrupts
| #define interrupts |
( |
| ) |
__asm__("cli") |
Enables maskable interrupts.
◆ LOW
◆ noInterrupts
| #define noInterrupts |
( |
| ) |
__asm__("sei") |
Disables maskable interrupts.
◆ OUTPUT
◆ analogWrite()
| void analogWrite |
( |
uint8_t |
pin, |
|
|
uint8_t |
level |
|
) |
| |
Sets the output level for an analog pin using Pulse Width Modulation (PWM).
PWM frequency and resolution may vary depending on the hardware variant and the specific pin used.
- Parameters
-
| pin | pin number |
| level | output level between 0 and 255 (Vcc) |
◆ delay()
| void delay |
( |
uint32_t |
milliseconds | ) |
|
Stops execution for the given amount of milliseconds.
- Parameters
-
| milliseconds | delay in milliseconds |
◆ digitalRead()
| uint8_t digitalRead |
( |
uint8_t |
pin | ) |
|
Reads state of an input pin.
- Parameters
-
◆ digitalWrite()
| void digitalWrite |
( |
uint8_t |
pin, |
|
|
uint8_t |
state |
|
) |
| |
Sets state of an output pin.
- Parameters
-
| pin | pin number |
| state | new state, either LOW or HIGH |
◆ loop()
◆ noTone()
| void noTone |
( |
uint8_t |
pin | ) |
|
Stops tone output.
- Parameters
-
◆ pinMode()
| void pinMode |
( |
uint8_t |
pin, |
|
|
uint8_t |
mode |
|
) |
| |
Sets mode of a pin.
- Parameters
-
| pin | pin number |
| mode | new mode, either INPUT or OUTPUT |
◆ setup()
◆ tone()
| void tone |
( |
uint8_t |
pin, |
|
|
uint16_t |
frequency |
|
) |
| |
Outputs a square wave with the given frequency in the range 10Hz..65kHz.
- Parameters
-
| pin | pin number |
| frequency | frequency im hertz |