GLOBAL SITE AUSTRALIAN SITE

IF clap | EdWare graphical programming | Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic3
IF clap
May 18, 2018
11:33 pm
Binary
New Member
Members
Forum Posts: 2
Member Since:
May 19, 2018
sp_UserOfflineSmall Offline

I am trying to move edison when i clap, but it doesn’t work. 

i don’t know why i can not upload an image…confused

i will try to describe my code. iis a very simple code.

Start-> Eventwait (time pass:5)-> If clap(Event happen:Detect clap)-> true ->dual drive (left motor, forward, speed:4)-> event wait (time pass:5)-                                                                                                       -> false -> nothing….

Could you suggest me a code which a can use the IF clap?

I tried with loop and it works, but i can not understand why it doesn’t work with the IFclap only?

May 22, 2018
11:03 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi 

from you description of your code, when it runs Edison will:

Sit still doing nothing for 5 seconds (no lights on, no driving, no sounds)

Then, if a clap was heard in that 5 seconds then it will drive for 5 seconds

if no clap was heard in that 5 seconds then Edison will just end the program.

Are you clapping or tapping the top of Edison in the first 5 seconds?

Also please note, that Edison will always wait the 5 seconds regardless of if you clap or not.

So if you clap 1 second into the wait, Edison will keep waiting for another 4 seconds before driving.

If you want Edison to drive immediately after you clap, change the event wait to: “Event happens: Detect Clap: Clap detected” and remove the IF statement.

May 23, 2018
4:33 pm
Binary
New Member
Members
Forum Posts: 2
Member Since:
May 19, 2018
sp_UserOfflineSmall Offline

This is my program

http://www.edwareapp.com/share/PDCcu

My program supposed to do this 

Sit still doing nothing for 5 seconds (no lights on, no driving, no sounds)

Then, if a clap was heard in that 5 seconds then it will drive for 5 seconds

if no clap was heard in that 5 seconds then Edison will do nothing and just end the program.

My problem is that edison, starts to move after the 5 sec, whether it hears the clap sound or not. I think that for some reason it is not reading the if clap. The clap sensor is working, i check that with a code from your tutorial.

May 24, 2018
10:40 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Ah, 

when you start a program, you press the triangle button, this causes Edisons circuit board to wobble a little, which means that as the program starts Edison detects a “clap”

In EdWare there is no inbuilt protection for this (the compiler handles this excess clap in EdBlocks) but you can fix it by doing one of two things:

adding a variable to the program and placing a blue “Detect Clap” block into the start of the program (this will read the setting of the clap sensor into the otherwise unused variable and then clear the sensor)

OR

Adding a “wait event” to the start of he program set to: detect clap – clap detected (however if Edison does not pick up the triangle button push clap, then this will cause the program to wait inside this block)

Personally I prefer the first option

  • Keep up with Edison

    Sign up for our newsletter to get all things Edison delivered straight to your inbox.

  • This field is for validation purposes and should be left unchanged.

Heads up

The Australian Federal Parliament has passed a law that extends goods and services tax (GST) to low value imports of physical goods imported by consumers from 1 July 2018.

This means that all customers purchasing Edison robots and accessories with an Australian shipping address must now pay GST. The GST will be automatically added to your purchase and show as a line item on your invoice.

We've detected that you are in Australia, so we wanted to let you know that we have changed your settings to view our Australian site, which displays GST inclusive pricing.

You can change back to the GLOBAL SITE at any time using the link in the top left of the page.

OK got it!    Take me to the GLOBAL SITE instead

Country

Pin It on Pinterest

Share This