March 10, 2017
How do I program Edison to detect the difference between a single clap and a double clap?
Thanks in advance.
August 24, 2015
If you load the “clap controlled driving” program in the “EdBook1 – Your a Controller” option of the load menu in Edware online you can see how we have programmed it.
Basically, we use:
Wait for event: Clap (detect the first clap),
Wait for event: time 0.1sec (wait a short time so the detected clap has passed),
Detect Clap (reads the value of the clap sensor into a junk variable, used to clear the clap sensor),
Wait for event: time 0.35sec (time in which the second clap can occur),
If: clap detected (if a clap has been detected at this point, it is the second clap, so the top line of the IF statement is the program for a double clap. the bottom line is the line for only a single clap)