Skip to content

Conversation

@bmcage
Copy link
Contributor

@bmcage bmcage commented Apr 28, 2016

A common problem in arduino programming for beginners is trying to do two things, but having learned to use delay() to do effects.
This PR adds a new function block to do effects and hides all the problems of working without delay.
WIth this function you can have 3 leds do different types of blinking at the same time, listen to a button being pressed, and rotate a servo, all in a package beginners are able to understand after a short explanation.

I have no test code in the master, but for example use in my branch with extra blocks, see example on how to do blink no delay from the arduino examples:

http://ingegno.be/Manuals/Blockly4Arduino/blockly4Arduino/index_en.html?url=examples/BlinkNoDelay.xml

above blocks can be explained to young children.
More advanced (button monitoring, LED strip and servo rotation):
http://ingegno.be/Manuals/Blockly4Arduino/blockly4Arduino/index.html?url=examples/MD_Caroussel_Muziek.xml

PS: I'm thinking of button handling code based on above button handling for a different PR, also for the LED strip.

bmcage added 7 commits April 28, 2016 15:25
Conflicts:
	blockly/blocks/arduino/procedures.js
	blockly/generators/arduino/procedures.js
	blockly/msg/messages.js
Conflicts:
	blockly/msg/json/nl.json
bugfix: if end was done, do start at next cycle, not immediately
 so that declare blocks are in code above the effect, also if
 block with declare is placed under effect on the canvas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant