Skip to content

Commit ba255ac

Browse files
committed
Update documentation
1 parent ed481e9 commit ba255ac

File tree

1 file changed

+96
-75
lines changed

1 file changed

+96
-75
lines changed

docs/api.md

+96-75
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
* [tone](#modulino.buzzer.ModulinoBuzzer.tone)
88
* [no\_tone](#modulino.buzzer.ModulinoBuzzer.no_tone)
99
* [buttons](#modulino.buttons)
10+
* [ModulinoButtonsLED](#modulino.buttons.ModulinoButtonsLED)
11+
* [on](#modulino.buttons.ModulinoButtonsLED.on)
12+
* [off](#modulino.buttons.ModulinoButtonsLED.off)
13+
* [value](#modulino.buttons.ModulinoButtonsLED.value)
14+
* [value](#modulino.buttons.ModulinoButtonsLED.value)
1015
* [ModulinoButtons](#modulino.buttons.ModulinoButtons)
1116
* [\_\_init\_\_](#modulino.buttons.ModulinoButtons.__init__)
17+
* [led\_a](#modulino.buttons.ModulinoButtons.led_a)
18+
* [led\_b](#modulino.buttons.ModulinoButtons.led_b)
19+
* [led\_c](#modulino.buttons.ModulinoButtons.led_c)
1220
* [set\_led\_status](#modulino.buttons.ModulinoButtons.set_led_status)
1321
* [long\_press\_duration](#modulino.buttons.ModulinoButtons.long_press_duration)
1422
* [long\_press\_duration](#modulino.buttons.ModulinoButtons.long_press_duration)
@@ -35,12 +43,6 @@
3543
* [button\_a\_pressed](#modulino.buttons.ModulinoButtons.button_a_pressed)
3644
* [button\_b\_pressed](#modulino.buttons.ModulinoButtons.button_b_pressed)
3745
* [button\_c\_pressed](#modulino.buttons.ModulinoButtons.button_c_pressed)
38-
* [pressure](#modulino.pressure)
39-
* [ModulinoPressure](#modulino.pressure.ModulinoPressure)
40-
* [\_\_init\_\_](#modulino.pressure.ModulinoPressure.__init__)
41-
* [pressure](#modulino.pressure.ModulinoPressure.pressure)
42-
* [temperature](#modulino.pressure.ModulinoPressure.temperature)
43-
* [altitude](#modulino.pressure.ModulinoPressure.altitude)
4446
* [modulino](#modulino.modulino)
4547
* [Modulino](#modulino.modulino.Modulino)
4648
* [default\_addresses](#modulino.modulino.Modulino.default_addresses)
@@ -126,10 +128,7 @@ Predefined notes are available in the NOTES dictionary e.g. ModulinoBuzzer.NOTES
126128

127129
Dictionary with the notes and their corresponding frequencies.
128130
The supported notes are defined as follows:
129-
- B0
130-
- C1, CS1, D1, DS1, E1, F1, FS1, G1, GS1, A1, AS1, B1
131-
- C2, CS2, D2, DS2, E2, F2, FS2, G2, GS2, A2, AS2, B2
132-
- C3, CS3, D3, DS3, E3, F3, FS3, G3, GS3, A3, AS3, B3
131+
- FS3, G3, GS3, A3, AS3, B3
133132
- C4, CS4, D4, DS4, E4, F4, FS4, G4, GS4, A4, AS4, B4
134133
- C5, CS5, D5, DS5, E5, F5, FS5, G5, GS5, A5, AS5, B5
135134
- C6, CS6, D6, DS6, E6, F6, FS6, G6, GS6, A6, AS6, B6
@@ -167,7 +166,7 @@ If blocking is set to True, the function will wait until the tone is finished.
167166

168167
**Arguments**:
169168

170-
- `frequency` - The frequency of the tone in Hz
169+
- `frequency` - The frequency of the tone in Hz (freuqencies below 180 Hz are not supported)
171170
- `lenght_ms` - The duration of the tone in milliseconds. If omitted, the tone will play indefinitely
172171
- `blocking` - If set to True, the function will wait until the tone is finished
173172

@@ -181,6 +180,59 @@ def no_tone() -> None
181180

182181
Stops the current tone from playing.
183182

183+
<a id="modulino.buttons.ModulinoButtonsLED"></a>
184+
185+
## class `ModulinoButtonsLED`
186+
187+
```python
188+
class ModulinoButtonsLED()
189+
```
190+
191+
Class to interact with the LEDs of the Modulino Buttons.
192+
193+
<a id="modulino.buttons.ModulinoButtonsLED.on"></a>
194+
195+
### `on`
196+
197+
```python
198+
def on()
199+
```
200+
201+
Turns the LED on.
202+
203+
<a id="modulino.buttons.ModulinoButtonsLED.off"></a>
204+
205+
### `off`
206+
207+
```python
208+
def off()
209+
```
210+
211+
Turns the LED off.
212+
213+
<a id="modulino.buttons.ModulinoButtonsLED.value"></a>
214+
215+
### `value`
216+
217+
```python
218+
@property
219+
def value()
220+
```
221+
222+
Returns the value of the LED (1 for on, 0 for off).
223+
224+
<a id="modulino.buttons.ModulinoButtonsLED.value"></a>
225+
226+
### `value`
227+
228+
```python
229+
@value.setter
230+
def value(value)
231+
```
232+
233+
Sets the value of the LED (1 for on, 0 for off).
234+
Calling this method will update the physical status of the LED immediately.
235+
184236
<a id="modulino.buttons.ModulinoButtons"></a>
185237

186238
## class `ModulinoButtons`
@@ -206,6 +258,39 @@ Initializes the Modulino Buttons.
206258
- `i2c_bus` _I2C_ - The I2C bus to use. If not provided, the default I2C bus will be used.
207259
- `address` _int_ - The I2C address of the module. If not provided, the default address will be used.
208260

261+
<a id="modulino.buttons.ModulinoButtons.led_a"></a>
262+
263+
### `led_a`
264+
265+
```python
266+
@property
267+
def led_a() -> ModulinoButtonsLED
268+
```
269+
270+
Returns the LED A object of the module.
271+
272+
<a id="modulino.buttons.ModulinoButtons.led_b"></a>
273+
274+
### `led_b`
275+
276+
```python
277+
@property
278+
def led_b() -> ModulinoButtonsLED
279+
```
280+
281+
Returns the LED B object of the module.
282+
283+
<a id="modulino.buttons.ModulinoButtons.led_c"></a>
284+
285+
### `led_c`
286+
287+
```python
288+
@property
289+
def led_c() -> ModulinoButtonsLED
290+
```
291+
292+
Returns the LED C object of the module.
293+
209294
<a id="modulino.buttons.ModulinoButtons.set_led_status"></a>
210295

211296
### `set_led_status`
@@ -506,70 +591,6 @@ def button_c_pressed() -> bool
506591

507592
Returns True if button C is currently pressed.
508593

509-
<a id="modulino.pressure.ModulinoPressure"></a>
510-
511-
## class `ModulinoPressure`
512-
513-
```python
514-
class ModulinoPressure(Modulino)
515-
```
516-
517-
Class to interact with the pressure sensor of the Modulino Pressure.
518-
519-
<a id="modulino.pressure.ModulinoPressure.__init__"></a>
520-
521-
### `__init__`
522-
523-
```python
524-
def __init__(i2c_bus: I2C = None, address: int = None) -> None
525-
```
526-
527-
Initializes the Modulino Pressure.
528-
529-
**Arguments**:
530-
531-
- `i2c_bus` _I2C_ - The I2C bus to use. If not provided, the default I2C bus will be used.
532-
- `address` _int_ - The I2C address of the module. If not provided, the default address will be used.
533-
534-
<a id="modulino.pressure.ModulinoPressure.pressure"></a>
535-
536-
### `pressure`
537-
538-
```python
539-
@property
540-
def pressure() -> float
541-
```
542-
543-
**Returns**:
544-
545-
- `float` - The pressure in hectopascals.
546-
547-
<a id="modulino.pressure.ModulinoPressure.temperature"></a>
548-
549-
### `temperature`
550-
551-
```python
552-
@property
553-
def temperature() -> float
554-
```
555-
556-
**Returns**:
557-
558-
- `float` - The temperature in degrees Celsius.
559-
560-
<a id="modulino.pressure.ModulinoPressure.altitude"></a>
561-
562-
### `altitude`
563-
564-
```python
565-
@property
566-
def altitude() -> float
567-
```
568-
569-
**Returns**:
570-
571-
- `float` - The altitude in meters.
572-
573594
<a id="modulino.modulino.Modulino"></a>
574595

575596
## class `Modulino`

0 commit comments

Comments
 (0)