Skip to content

Commit 296eeb8

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents cda3d12 + 711d286 commit 296eeb8

File tree

34 files changed

+833
-157
lines changed

34 files changed

+833
-157
lines changed

.github/workflows/compile-examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- source-path: ./
4848
# Install library dependencies.
4949
- name: STM32duino VL53L4CD
50+
- name: STM32duino VL53L4ED
5051
- name: Arduino_LSM6DSOX
5152
- name: Arduino_LPS22HB
5253
- name: Arduino_HS300x

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 🧩 Arduino Modulino® Library
2+
3+
The Arduino Modulino® Library simplifies the integration and management of Modulino® modules on Arduino boards.
4+
5+
A Modulino® is a compact, modular electronic device that connects easily to Arduino via the Qwiic connector and communicates using the I2C (`Wire`) protocol. These modules include sensors, actuators, and more.
6+
7+
📖 For more information about this library please read the documentation [here](./docs/).
8+
9+
## Hardware Compatibility
10+
This library is compatible with all Arduino boards that feature an I2C interface (`Wire`).
11+
12+
## Support and Contributions
13+
If you find this library helpful, consider supporting us through [donations](https://www.arduino.cc/en/donate/), [sponsorship](https://github.com/sponsors/arduino) or check out our [store](https://store.arduino.cc/).

docs/api.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Arduino Modulino Library API
2+
3+
## Summary
4+
5+
Members | Descriptions
6+
--------------------------------------------|------------------------------------------
7+
| `class` [`ModulinoClass`](#modulinoclass) | The base class for all Modulino components, providing essential functionality and structure for all subsequent Modulino modules. |
8+
| `class` [`ModulinoButtons`](#modulinobuttons) | Handles the functionality of Modulino Buttons, enabling detection of presses and handling input events. |
9+
| `class` [`ModulinoBuzzer`](#modulinobuttons) |Handles the functionality of Modulino Buzzer, enabling the sound generation for feedback or alerts. |
10+
| `class` [`ModulinoPixels`](#modulinopixels) | Handles the functionality of Modulino Pixels, managing LEDs strip color, status and brightness. |
11+
| `class` [`ModulinoKnob`](#modulinoknob) | Handles the functionality of Modulino Knob, interfacing with the rotary knob position. |
12+
| `class` [`ModulinoMovement`](#modulinomovement) | Handles the functionality of Modulino Movement,interfacing with the IMU sensor to get acceleration readings. |
13+
| `class` [`ModulinoThermo`](#modulinothermo) | Handles the functionality of Modulino Thermo, managing temperature sensors to provide real-time temperature and humidity readings. |
14+
| `class` [`ModulinoDistance`](#modulinodistance) | Handles the functionality of Modulino Distance, enabling distance measurement using ToF (Time-of-Flight) sensors for precise range detection. |
15+
16+
### ModulinoClass
17+
18+
The `ModulinoClass` is the main class that handles the initialization of the I2C communication bus.
19+
20+
#### Methods
21+
22+
- **`void begin(HardwareI2C& wire = Wire)`**
23+
Initializes the I2C communication. The default I2C bus is `Wire`, but you can specify another one (e.g., `Wire1`).
24+
25+
---
26+
27+
### ModulinoButtons
28+
29+
Represents a Modulino Buttons module.
30+
31+
#### Methods
32+
33+
- **`PinStatus isPressed(int index)`**
34+
Returns the press status (HIGH/LOW) of the button at the specified index (_0-A, 1-B, 2-C_).
35+
36+
- **`bool update()`**
37+
Updates the button status. Returns `true` if the status has changed, `false` otherwise.
38+
39+
- **`void setLeds(bool a, bool b, bool c)`**
40+
Sets the LED states. Each argument corresponds to one LED's state (on/off).
41+
42+
---
43+
44+
### ModulinoBuzzer
45+
46+
Represents a Modulino Buzzer module.
47+
48+
#### Methods
49+
50+
- **`void tone(size_t freq, size_t len_ms)`**
51+
Plays a tone at the specified frequency (`freq`) and duration (`len_ms`).
52+
53+
- **`void noTone()`**
54+
Stops any tone currently playing.
55+
56+
---
57+
58+
### ModulinoPixels
59+
60+
Represents a Modulino Pixels module.
61+
62+
#### Methods
63+
64+
- **`void set(int idx, ModulinoColor rgb, uint8_t brightness = 25)`**
65+
Sets the color of the LED at the specified index.
66+
67+
- **`void set(int idx, uint8_t r, uint8_t g, uint8_t b, uint8_t brightness = 5)`**
68+
Sets the color of the LED at the specified index using RGB values.
69+
70+
- **`void clear(int idx)`**
71+
Clears the LED at the specified index (turns it off).
72+
73+
- **`void clear()`**
74+
Clears all LEDs (turns them all off).
75+
76+
- **`void show()`**
77+
Updates the LEDs to display the current color data.
78+
79+
---
80+
81+
### ModulinoKnob
82+
83+
Represents a Modulino Knob module.
84+
85+
#### Methods
86+
87+
- **`int16_t get()`**
88+
Gets the current value of the knob.
89+
90+
- **`bool isPressed()`**
91+
Returns `true` if the button on the knob is pressed, `false` otherwise.
92+
93+
- **`void set(int16_t value)`**
94+
Sets the knob value.
95+
96+
---
97+
98+
### ModulinoMovement
99+
100+
Represents a Modulino Movement module.
101+
102+
#### Methods
103+
104+
- **`int update()`**
105+
Updates the sensor data and reads the acceleration values.
106+
107+
- **`int available()`**
108+
Returns `true` if acceleration data is available.
109+
110+
- **`float getX()`**
111+
Returns the X-axis acceleration.
112+
113+
- **`float getY()`**
114+
Returns the Y-axis acceleration.
115+
116+
- **`float getZ()`**
117+
Returns the Z-axis acceleration.
118+
119+
---
120+
121+
### ModulinoThermo
122+
123+
Represents a Modulino Thermo module.
124+
125+
#### Methods
126+
127+
- **`float getHumidity()`**
128+
Returns the humidity reading.
129+
130+
- **`float getTemperature()`**
131+
Returns the temperature reading.
132+
133+
---
134+
135+
### ModulinoDistance
136+
137+
Represents a Modulino Distance module.
138+
139+
#### Methods
140+
141+
- **`available()`**
142+
Checks if new distance data is available from the sensor. If data is ready, it reads the data and updates the distance value.
143+
`true` if distance data is available, `false` if distance data is not available.
144+
145+
- **`float get()`**
146+
Returns the distance measured by the sensor in millimeters.
147+
The measured distance in millimeters if available, `NAN` if the distance reading is invalid.
148+
149+
## Constants
150+
151+
- **`ModulinoColor RED`**
152+
Represents the color red for Modulino Pixels modules.
153+
154+
- **`ModulinoColor BLUE`**
155+
Represents the color blue for Modulino Pixels modules.
156+
157+
- **`ModulinoColor GREEN`**
158+
Represents the color green for Modulino Pixels modules.
159+
160+
- **`ModulinoColor VIOLET`**
161+
Represents the color violet for Modulino Pixels modules.
162+
163+
- **`ModulinoColor WHITE`**
164+
Represents the color white for Modulino Pixels modules.
165+
166+
### ModulinoColor
167+
168+
Represents a color for Modulino Pixels modules.
169+
170+
#### Constructor
171+
172+
- **`ModulinoColor(uint8_t r, uint8_t g, uint8_t b)`**
173+
Creates a color with the specified red (`r`), green (`g`), and blue (`b`) components.
174+
175+
## License
176+
177+
This library is released under the [MPL-2.0 license](../LICENSE).

docs/images/modulino-buttons.jpeg

183 KB
Loading

docs/images/modulino-buzzer.jpg

168 KB
Loading

docs/images/modulino-distance.jpg

137 KB
Loading

docs/images/modulino-knob.jpg

156 KB
Loading

docs/images/modulino-movement.jpg

158 KB
Loading

docs/images/modulino-pixels.jpg

175 KB
Loading

docs/images/modulino-thermo.jpg

144 KB
Loading

0 commit comments

Comments
 (0)