GLOBAL SITE AUSTRALIAN SITE

[SOLVED] "Incorrect argument used in Ed.Drive_TIME call" error badly located | EdPy 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
[SOLVED] "Incorrect argument used in Ed.Drive_TIME call" error badly located
November 26, 2017
1:05 am
Pierre
New Member
Members
Forum Posts: 1
Member Since:
November 26, 2017
sp_UserOfflineSmall Offline

Hi,

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.

#————-Setup—————-

import Ed

Ed.EdisonVersion = Ed.V1
Ed.DistanceUnits = Ed.TIME
Ed.Tempo = Ed.TEMPO_MEDIUM

#——–Your code below———–

awesome_tube = Ed.TuneString(33, “a1b1c1d1e1f1g1m1n1R2A1G1F1D1C1N1z”)

def wait_for_clap():
“””Wait for a clap and trigger action when clap is detected
“””
while not Ed.EVENT_CLAP_DETECTED:
pass
return

def avoid_line():
“””Make Edison bip and make a U-turn
“””
Ed.PlayBeep()
Ed.TimeWait(1, Ed.TIME_SECONDS)
Ed.Drive(Ed.SPIN_RIGHT, Ed.SPEED_2, 120)

def play_music_and_stop():
“””Stop and play music
“””
Ed.Drive(Ed.STOP) ######### THERE IS A MISTAKE HERE
Ed.PlayTune(awesome_tube)
while Ed.MUSIC_NOT_FINISHED:
pass
return

def stay_in_lines():
“””Make Edison move and stay in between black lines
“””
# activate the linetracker.
Ed.LineTrackerLed(Ed.ON)
# register function avoid_line as behaviour in case a black line is detected
Ed.RegisterEventHandler(Ed.EVENT_LINE_TRACKER_ON_BLACK, “avoid_line”)
# 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)
return

wait_for_clap()
stay_in_lines()
play_music_and_stop()

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.

November 30, 2017
10:05 am
Ben
Admin
Forum Posts: 179
Member Since:
August 24, 2015
sp_UserOfflineSmall Offline

Hi 

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

  • 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