Skip to content

Commit d739b6d

Browse files
committed
Update reference.md
1 parent eaa336d commit d739b6d

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

content/learn/03.programming/00.reference/reference.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ tags: [Reference, Arduino API]
55
author: Karl Söderby
66
---
77

8-
Compact version of the [Arduino Language Reference](https://www.arduino.cc/reference/en/).
8+
Compact version of the [Arduino Language Reference](https://www.arduino.cc/reference/en/). This document is a **TLDR;** of the Arduino API.
99

10-
***Please note that as of 2024/01/05, this article is a work in progress.***
10+
***Please note that as of 2024/01/05, this article is still a work in progress.***
1111

1212
## Functions
1313

1414
### Digital I/O
1515

16-
| Method | Description | Returns |
16+
| Method & Parameters | Description | Returns |
1717
| --------------------------------------- | --------------------------------- | ------- |
1818
| `int digitalRead(int pin)` | Reads the state of a digital pin. | `int` |
1919
| `void digitalWrite(int pin, int state)` | Writes a state to a digital pin. | Nothing |
@@ -28,16 +28,17 @@ Compact version of the [Arduino Language Reference](https://www.arduino.cc/refer
2828

2929
### Analog I/O
3030

31-
| Method | Description | Returns |
32-
| -------------------------------------------- | ---------------------------------------------- | -------------------------------------- |
33-
| `int analogRead(int pin)` | Reads the value of an analog pin. | `int` - value from the ADC (0-1023).\* |
34-
| `void analogReadResolution(int resolution)` | Sets ADC read resolution in bits. | Nothing |
35-
| `void analogReference(int reference)` | Changes the voltage reference for a board.** | Nothing |
36-
| `void analogWrite(int pin, int value)` | Writes a value to a PWM supported pin (0-255). | Nothing |
37-
| `void analogWriteResolution(int resolution)` | Sets write resolution for a board. | Nothing |
31+
| Method & Parameters | Description | Returns |
32+
| -------------------------------------------- | ---------------------------------------------------------------------- | ------- |
33+
| `int analogRead(int pin)` | Reads the value of an analog pin in a 10-bit resolution (0-1023).\* | `int` |
34+
| `void analogReadResolution(int resolution)` | Sets ADC read resolution in bits. | Nothing |
35+
| `void analogReference(int reference)` | Changes the voltage reference for a board.** | Nothing |
36+
| `void analogWrite(int pin, int value)` | Writes a value to a PWM supported pin in a 8-bit resolution (0-255).** | Nothing |
37+
| `void analogWriteResolution(int resolution)` | Sets write resolution for a board. | Nothing |
3838

3939
- \*The value range changes based on the resolution. 0-1023 is 10-bit resolution, 0-4096 is 12-bit and so on.
40-
- **Each board/architecture has a set of different reference voltages available. See the [analog reference page]() for more details.
40+
- **Each board/architecture has a set of different reference voltages available.
41+
- ***The value range changes based on the resolution. 0-255 is default (8-bit).
4142

4243
### Advanced I/O
4344

@@ -146,7 +147,7 @@ Compact version of the [Arduino Language Reference](https://www.arduino.cc/refer
146147
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------- |
147148
| `int available()` | Returns the number of bytes available in the serial buffer. | `int` |
148149
| `int read()` | Reads the next byte from the serial buffer. | `int` |
149-
| `void flush()` | Waits for the transmission of outgoing serial data to complete. | |
150+
| `void flush()` | Waits for the transmission of outgoing serial data to complete. | Nothing |
150151
| `int find(char *target)` | Searches for a target string in the serial buffer. | `int` |
151152
| `int findUntil(char *target, char *terminate)` | Searches for a target string until a specified termination string is found. | `int` |
152153
| `int peek()` | Returns the next byte in the serial buffer without removing it. | `int` |
@@ -156,7 +157,7 @@ Compact version of the [Arduino Language Reference](https://www.arduino.cc/refer
156157
| `String readStringUntil(char terminator)` | Reads characters from the serial buffer into a String until a specified terminator is found. | `String` |
157158
| `int parseInt()` | Reads characters from the serial buffer and converts them to an integer. | `int` |
158159
| `float parseFloat()` | Reads characters from the serial buffer and converts them to a float. | `float` |
159-
| `void setTimeout(unsigned long timeout)` | Sets the maximum duration for `find()`, `findUntil()`, `parseInt()`, and `parseFloat()`. | |
160+
| `void setTimeout(unsigned long timeout)` | Sets the maximum duration for `find()`, `findUntil()`, `parseInt()`, and `parseFloat()`. | Nothing |
160161

161162
### Serial
162163

0 commit comments

Comments
 (0)