diff options
| author | Jacob Rosenthal <[email protected]> | 2021-11-11 19:58:45 -0700 |
|---|---|---|
| committer | Jacob Rosenthal <[email protected]> | 2021-11-11 19:58:45 -0700 |
| commit | 639034cee402c27a50174641a79d92673d0ade30 (patch) | |
| tree | 2d44e9a3afe70b0d535478b8750049e68ccf82fe /examples | |
| parent | fe83daf45ff2a7e8b76425b53903d75548dc458f (diff) | |
fix
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/pwm_sequence.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 2b8a3a7d6..e8ce40eff 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs | |||
| @@ -14,7 +14,7 @@ use embassy_nrf::Peripherals; | |||
| 14 | #[embassy::main] | 14 | #[embassy::main] |
| 15 | async fn main(_spawner: Spawner, p: Peripherals) { | 15 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 16 | // for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='') | 16 | // for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='') |
| 17 | let seq_values: [u16; 1024] = [ | 17 | let mut seq_values: [u16; 1024] = [ |
| 18 | 8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, | 18 | 8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, |
| 19 | 9440, 9526, 9613, 9700, 9787, 9874, 9962, 10050, 10139, 10227, 10316, 10406, 10495, 10585, | 19 | 9440, 9526, 9613, 9700, 9787, 9874, 9962, 10050, 10139, 10227, 10316, 10406, 10495, 10585, |
| 20 | 10675, 10766, 10857, 10948, 11039, 11131, 11223, 11315, 11407, 11500, 11592, 11685, 11779, | 20 | 10675, 10766, 10857, 10948, 11039, 11131, 11223, 11315, 11407, 11500, 11592, 11685, 11779, |
| @@ -98,7 +98,13 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 98 | config.refresh = 3; | 98 | config.refresh = 3; |
| 99 | 99 | ||
| 100 | let pwm = unwrap!(SequencePwm::new( | 100 | let pwm = unwrap!(SequencePwm::new( |
| 101 | p.PWM0, p.P0_13, NoPin, NoPin, NoPin, config, seq_values | 101 | p.PWM0, |
| 102 | p.P0_13, | ||
| 103 | NoPin, | ||
| 104 | NoPin, | ||
| 105 | NoPin, | ||
| 106 | config, | ||
| 107 | &mut seq_values | ||
| 102 | )); | 108 | )); |
| 103 | let _ = pwm.start(SequenceMode::Infinite); | 109 | let _ = pwm.start(SequenceMode::Infinite); |
| 104 | info!("pwm started!"); | 110 | info!("pwm started!"); |
