forked from zhaolei/WiringOP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request zhaolei#9 from pctj101/fixPwmTone
Fix duty cycle to half period
- Loading branch information
Showing
3 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Example of how to export PWM Pin and play tones via CLI | ||
|
||
export WIRINGPI_DEBUG=true | ||
export WIRINGPI_CODES=true | ||
GPIO=../gpio/gpio | ||
|
||
$GPIO export 1 out | ||
$GPIO mode 1 pwm | ||
$GPIO pwmTone 1 1033 | ||
|
||
for i in 262 523 220 440 233 466 0 0 262 523 220 440 233 466 0 0 175 349 147 294 156 311 0 0 175 349 147 294 156 311 0 0 311 277 294 277 311 311 208 196 277 262 370 349 165 466 440 415 311 247 233 220 208 0 0 0 ; do | ||
$GPIO pwmTone 1 $i; | ||
sleep 0.15; | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters