Merge pull request #71 from Logout22/master

port soft tone example from WiringPi
pull/72/head
Mark Liffiton 6 years ago committed by GitHub
commit ece03e240c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,16 @@
# Test of the softTone module in wiringPi
# Plays a scale out on pin 3 - connect pizeo disc to pin 3 & 0v
import wiringpi
PIN = 3
SCALE = [262, 294, 330, 349, 392, 440, 494, 525]
wiringpi.wiringPiSetup()
wiringpi.softToneCreate(PIN)
while True:
for idx in range(8):
print(idx)
wiringpi.softToneWrite(PIN, SCALE[idx])
wiringpi.delay(500)
Loading…
Cancel
Save