Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
emeric-martineau committed Jul 4, 2024
1 parent 0da169e commit cdffc4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1
unsafe {
let zero_crossing_pin: PinDriver<'static, AnyInputPin, Input> = PinDriver::input(AnyInputPin::new(2)).unwrap();
let d0_pin: PinDriver<'static, AnyOutputPin, Output> = PinDriver::output(AnyOutputPin::new(4)).unwrap();
let mut d = DimmerDevice::new(0, d0_pin);
d.set_power(10);
let id: u8 = 0;
let d = DimmerDevice::new(id, d0_pin);

// Create Power management
let ddm = DevicesDimmerManager::init(DevicesDimmerManagerConfig::default_50_hz(zero_crossing_pin, vec![d])).unwrap();

rbd_dimmer::set_power(id, 100).unwrap();

loop {
let _ = ddm.wait_zero_crossing();
rbd_dimmer::wait_zero_crossing().unwrap();
}
}
```

That's all!
Expand Down
2 changes: 1 addition & 1 deletion doc/HOW-IT-WORKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When you read the characteristics of a load, you see V=230V, In=10A, P=1800W for

These values are not max values but RMS values. Max value is RMS value multiplied by square root of 2.

## Theorie of manage
## Theorie of management

To manage power (for example, you want use 50%, 900W, in previous example), we will turn on power only on half sinusoidal.

Expand Down

0 comments on commit cdffc4a

Please sign in to comment.