S3 and BlocklyProp
The S3 plays with its ancestors using this Ping))) ultrasonic sensor hack to the Hacker's Port and some nifty BlocklyProp code from Ken Gracey.
Here is what Ken's BlocklyProp code looks like - the neat thing about Blockly code is that it explains itself - take a look (I did modify the if do minimum distance in the video example above so the S3 would turn before bump its next of kin!).
The loop repeats forever. A variable named distanceCM is set by the green block that measure distance in cm from a PIng))) on pin 5. The play tone uses that variable multiplied by 5 to create and play a tone. Motor speeds are decreased as the distance to an obstacle decreases. If the minimum allowed distance is reached, then the S3 rotates 180 degrees and the cycle begins again.
This complex bit of coding is a breeze with BlocklyProp! Give it try!
Here is what Ken's BlocklyProp code looks like - the neat thing about Blockly code is that it explains itself - take a look (I did modify the if do minimum distance in the video example above so the S3 would turn before bump its next of kin!).
The loop repeats forever. A variable named distanceCM is set by the green block that measure distance in cm from a PIng))) on pin 5. The play tone uses that variable multiplied by 5 to create and play a tone. Motor speeds are decreased as the distance to an obstacle decreases. If the minimum allowed distance is reached, then the S3 rotates 180 degrees and the cycle begins again.
This complex bit of coding is a breeze with BlocklyProp! Give it try!
Comments
He? You mean you! Great little program by the way - One of the few times my wife had been impressed by something with my robots. ;-)
So we can simulate DTMF and 56K modem sweetness! Need to put these $10 water speakers onboard S3.
--
Strange... Erco why are your robots visiting a location closer to your state capital?
Scratch and Google Introduce Scratch Blocks