November 26, 2017
I’m just getting started with my new Edison V1. I’m trying to make a simple program, similar to one of those used in the tutorials.
I encoutered a strange compiler behaviour in error catching. Here is the code I have written.
Ed.EdisonVersion = Ed.V1
Ed.DistanceUnits = Ed.TIME
Ed.Tempo = Ed.TEMPO_MEDIUM
#——–Your code below———–
awesome_tube = Ed.TuneString(33, “a1b1c1d1e1f1g1m1n1R2A1G1F1D1C1N1z”)
“””Wait for a clap and trigger action when clap is detected
while not Ed.EVENT_CLAP_DETECTED:
“””Make Edison bip and make a U-turn
Ed.Drive(Ed.SPIN_RIGHT, Ed.SPEED_2, 120)
“””Stop and play music
Ed.Drive(Ed.STOP) ######### THERE IS A MISTAKE HERE
“””Make Edison move and stay in between black lines
# activate the linetracker.
# register function avoid_line as behaviour in case a black line is detected
# Make Edison drive Forward as long as no clap is detected
while not Ed.EVENT_KEYPAD_TRIANGLE:
Ed.Drive(Ed.FORWARD, Ed.SPEED_2, Ed.DISTANCE_UNLIMITED)
I get the “Incorrect argument used in Ed.Drive_TIME call” located on line 25 whereas it occurs on line 30. Furthermore, the error code is not right I think as it should be something like Ed.Drive arguments do not match caller ones.
This is quiet confusing when debugging.
August 24, 2015
Thanks for the feedback, I’ll pass this onto the developers.
When attempting to debug code, error messages won’t always make sense, sanity checking code (making sure syntax is correct, functions are called correctly, variables are spelt correctly) is always the best place to start