Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

MakeCode CPX Sound Sensor Trigger Issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MakeCode CPX Sound Sensor Trigger Issue

by KathyCeceri on Mon Apr 26, 2021 1:20 pm

When I write a MakeCode program with an "on loud sound" trigger, it always seems to run when I turn the CPX board on. I tried adding a pause in an "on start" block in case the noise of switching it on was the problem, but that has not solved it. Any ideas? Please note that I am writing demonstration programs for beginners (8-11 yo and 12-16 yo), so if it's a complicated coding fix, I'll just leave it be.

Also, I have no updated the firmware on my CPX boards in more than a year, could that be an issue? Thanks!

KathyCeceri
 
Posts: 45
Joined: Sun Mar 02, 2014 7:30 pm

Re: MakeCode CPX Sound Sensor Trigger Issue

by mikeysklar on Wed Apr 28, 2021 3:05 pm

Along the same lines as you "pause" upon startup would it make sense to not let the code start running until button A has been pressed?

"on button A pressed"

mikeysklar
 
Posts: 4576
Joined: Mon Aug 01, 2016 8:10 pm

Re: MakeCode CPX Sound Sensor Trigger Issue

by KathyCeceri on Thu Apr 29, 2021 4:07 pm

mikeysklar wrote:Along the same lines as you "pause" upon startup would it make sense to not let the code start running until button A has been pressed?

"on button A pressed"


I was thinking of something similar, using the left/right switch. The problem is that you can't nest the "on loud sound" block inside another block. I will be teaching them how to build their own using If/Then/Else, but for a first project, it's too complicated.

KathyCeceri
 
Posts: 45
Joined: Sun Mar 02, 2014 7:30 pm

Please be positive and constructive with your questions and comments.