Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Circuit Playground Express Cricket Coding
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Circuit Playground Express Cricket Coding

by htmagic on Tue Jun 23, 2020 7:50 pm

Hello,

I reset the power on the Crickit Hat and reloaded the seesaw firmware.
Now it samples the mic and the plotter works as well.
I finally got the Scream code to work.

I set the threshold to 500 instead of 1000.
Eventually, I want to eliminate the mic and use the IO signals from a RC unit.

For servo 1, I want to move the servo back and forth for about a minute.
I also want servo 1 to move back and forth slower, so I modified these lines:

else:
print("LOUD")
head_servo.angle = 60
time.sleep(.05)
head_servo.angle = 120
time.sleep(.05)
head_servo.angle = 90
time.sleep(.02)
play_file("scream_low.wav")
head_servo.angle = 90
time.sleep(2)

I modified it to this:

else:
print("LOUD")
head_servo.angle = 60
time.sleep(.7505)
head_servo.angle = 120
time.sleep(.7505)
head_servo.angle = 90
time.sleep(.502)
head_servo.angle = 60
time.sleep(.7505)
head_servo.angle = 120
time.sleep(.7505)
head_servo.angle = 90
time.sleep(.502)
head_servo.angle = 60
time.sleep(.7505)
head_servo.angle = 120
time.sleep(.7505)
head_servo.angle = 90
time.sleep(.502)
play_file("scream_low.wav")
head_servo.angle = 90
time.sleep(2)

Is there a more elegant way of doing this? I will not use the scream_low.wav file and will replace it with something else.
I may even decide not to use a wav file at all so the audio portion may be eliminated.

Thanks in advance for your help.
May the FORCE be with you and have a magical day!

MagicBill

htmagic
 
Posts: 34
Joined: Tue Dec 03, 2013 12:18 am

Please be positive and constructive with your questions and comments.