June 11, 2017
Hi to everyone.
Please explain what happens if we use a loop and inside there isn’t an event wait like the above. How much time the dual motor drive will go on? Can we use an event wait block 0.1 sec after each dual drive or is it wrong?
Also all my posts awaiting moderation, one of them is answered but still waits moderation.
August 24, 2015
This program is a follow the torch program, it is designed so that Edison is checking where the torch is as often as possible.
To do this, you need to think of the Dual Drive blocks as switches. They simply tell Edison to switch the motors on at a certain speed.
When the program starts it:
Enters the loop -> reads both light levels -> subtracts one from the other -> turns on the motors so Edison turns towards the light -> loops back to that start (from here on out, Edisons motors will always be on, but the direction will change based on where the torch is)
All of these actions take approximately a hundredth of a second, so Edison has not turned very far when the second loop starts:
Read both light levels -> subtracts one from the other -> goes to turns on the motors so Edison turns towards the light but they are already on from the previous loop
This will loop around a few hundred times before Edison turns far enough that the light is now slightly brighter on the other side. During the next loop, Edison will take the opposite track in the If and the motors will turn on in the other direction.
The length of time the motors are moving in one direction is controlled by the loop and the sensor values used in the IF statement.
Adding an event wait block 0.1 sec after each dual drive will slow down the frequency of sensing and Edison won’t follow the torch very well