Skip to content

Commit 0120975

Browse files
committed
Readme improvements
1 parent 12e38c1 commit 0120975

File tree

3 files changed

+32
-28
lines changed

3 files changed

+32
-28
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ We also maintain a C++/CMake boilerplate with GitHub workflows configured for te
116116
* MICS6814 - Gas Sensor - https://shop.pimoroni.com/products/mics6814-gas-sensor-breakout
117117
* RGB Potentiometer - https://shop.pimoroni.com/products/rgb-potentiometer-breakout
118118
* RGB Encoder - https://shop.pimoroni.com/products/rgb-encoder-breakout
119+
* RGB Encoder Wheel - https://shop.pimoroni.com/products/rgb-encoder-wheel-breakout
119120
* IO Expander - https://shop.pimoroni.com/products/io-expander
120121
* RV3028 - Real-Time Clock (RTC) - https://shop.pimoroni.com/products/rv3028-real-time-clock-rtc-breakout
121122
* ST7735 - 0.96" LCD - https://shop.pimoroni.com/products/0-96-spi-colour-lcd-160x80-breakout

libraries/breakout_encoder_wheel/README.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ wheel.set_rgb(0, 255, 0, 255);
131131
Set the first LED - `0` - to Red `0.0`:
132132

133133
```c++
134-
wheel.set_hsv(0, 0.0, 1.0, 1.0);
134+
wheel.set_hsv(0, 0.0f, 1.0f, 1.0f);
135135
```
136136

137137

@@ -239,7 +239,7 @@ BreakoutEncoderWheel wheel(&i2c);
239239
wheel.gpio_pin_mode(GP7, IOExpander::PIN_PWM);
240240

241241
// Set the gpio pin's frequency to 25KHz, and record the cycle period
242-
uint16_t period = wheel.gpio_pwm_frequency(25000);
242+
uint16_t period = wheel.gpio_pwm_frequency(25000.0f);
243243

244244
// Output a 50% duty cycle square wave
245245
wheel.gpio_pin_value(GP7, (int)(period * 0.5f));
@@ -264,29 +264,34 @@ All of Encoder Wheel's PWM outputs share the same timing parameters. This means
264264
265265
Here is the complete list of functions available on the `BreakoutEncoderWheel` class:
266266
```c++
267-
BreakoutEncoderWheel(ioe_address=0x13, led_address=0x77, interrupt=PIN_UNUSED)
268-
set_ioe_address(address)
269-
pressed(button)
270-
count()
271-
delta()
272-
step()
273-
turn()
274-
zero()
275-
revolutions()
276-
degrees()
277-
radians()
278-
direction()
279-
direction(direction)
280-
set_rgb(index, r, g, b)
281-
set_hsv(index, h, s=1.0, v=1.0)
282-
clear()
283-
show()
284-
gpio_pin_mode(gpio)
285-
gpio_pin_mode(gpio, mode)
286-
gpio_pin_value(gpio)
287-
gpio_pin_value(gpio, value)
288-
gpio_pwm_load(wait_for_load=True)
289-
gpio_pwm_frequency(frequency, load=True, wait_for_load=True)
267+
BreakoutEncoderWheel(uint8_t ioe_address = DEFAULT_IOE_I2C_ADDRESS, uint8_t led_address = DEFAULT_LED_I2C_ADDRESS);
268+
BreakoutEncoderWheel(I2C *i2c, uint8_t ioe_address = 0x13, uint8_t led_address = 0x77, uint interrupt = PIN_UNUSED, uint32_t timeout = 1, bool debug = false);
269+
bool init(bool skip_chip_id_check = false);
270+
void set_ioe_address(uint8_t address);
271+
bool get_interrupt_flag();
272+
void clear_interrupt_flag();
273+
bool pressed(uint button);
274+
int16_t count();
275+
int16_t delta();
276+
void zero();
277+
int16_t step();
278+
int16_t turn();
279+
float revolutions();
280+
float degrees();
281+
float radians();
282+
Direction direction();
283+
void direction(Direction direction);
284+
void set_rgb(int index, int r, int g, int b);
285+
void set_hsv(int index, float h, float s = 1.0f, float v = 1.0f);
286+
void clear();
287+
void show();
288+
uint8_t gpio_pin_mode(uint8_t gpio);
289+
void gpio_pin_mode(uint8_t gpio, uint8_t mode);
290+
int16_t gpio_pin_value(uint8_t gpio);
291+
float gpio_pin_value_as_voltage(uint8_t gpio);
292+
void gpio_pin_value(uint8_t gpio, uint16_t value, bool load = true, bool wait_for_load = false);
293+
void gpio_pwm_load(bool wait_for_load = true);
294+
uint16_t gpio_pwm_frequency(float frequency, bool load = true, bool wait_for_load = false);
290295
```
291296

292297
## Constants Reference
@@ -315,15 +320,13 @@ Here is the complete list of public constants in the `encoderwheel` namespace:
315320
* `RIGHT` = `3`
316321
* `CENTRE` = `4`
317322

318-
319323
### GPIO Constants
320324

321325
* `GP7` = `7`
322326
* `GP8` = `8`
323327
* `GP9` = `9`
324328
* `GPIOS` = (`7`, `8`, `9`)
325329

326-
327330
### Count Constants
328331

329332
* `NUM_LEDS` = `24`

micropython/modules/breakout_encoder_wheel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Below is an example of setting a gpio pin to output a 25KHz signal with a 50% du
225225
from pimoroni_i2c import PimoroniI2C
226226
from pimoroni import BREAKOUT_GARDEN_I2C_PINS # or PICO_EXPLORER_I2C_PINS or HEADER_I2C_PINS
227227
from breakout_ioexpander import PWM
228-
from breakout_encoderwheel import BreakoutEncoderWheel, GP7
228+
from breakout_encoder_wheel import BreakoutEncoderWheel, GP7
229229

230230
# Initialise EncoderWheel
231231
i2c = PimoroniI2C(**BREAKOUT_GARDEN_I2C_PINS)

0 commit comments

Comments
 (0)