July 27, 2017
Whats the best way to report a bug in edblocks? Is here a suitable place?
Unless I am miss-understanding something, I have found that changing objects outside of loops occasionally modifies the behaviour/timing of what is happening inside the loop. I have noticed something funny a few times, but thought it was just the slipper glass surface screwing things up, but today it was obvious.
(Move 0.1, Turn 0.01) inside a loop that repeats 100 times, results in Ed doing a circle about 1m in diameter, taking about 10 seconds.
If I then put a ‘wait till clap’ after the above loop, and put the lot inside a loop forever, I would expect it to do the the same 10 second 1m loop, then stop, once I clap it should do another loop…. but instead an ~0.4 second delay gets introduced between each move and turn in the inner loop.
Resulting in a slightly bigger (due to it being stationary when it starts turning perhaps) and much slow 3/4 circle – It eventually stops and waits for the clap, but its a little frustrating that the inner loop changes behavour – especially when it happened just after explaining to my 5 year old that it should behave the same as the loop hasn’t changed.
August 24, 2015
This is part of EdBlocks being a beginners programming language.
When Edison drives, the vibrations of the motors trigger the “clap”.
As with most of Edison’s sensors, Edison is continuously looking for the input, and when an event is triggered it saves that information to a section in memory, creating a flag.
The wait for blocks do not access the sensors directly, they look at flags. Which means without protections and compiler magic, a “Wait for Clap” block directly after a drive block would see the flag set by the drive noise and instantly jump to the next block.
To avoid this (because it would be super confusing to a user) the compiler adds some protections around each Drive block when any block that references claps (wait for clap, new event clap, e.c.t. ) is added to the code. These protections take time to run and must be on the drive block because of the “New Event” case.
These protections could potentially get tidied up and shortened, I’ll add it to our list to look at in the future.
In your case, if you change the “wait untill clap” to “Wait until triangle button is pushed” the drive blocks will behave normally again