Effectfun#72
Open
bmcage wants to merge 7 commits intocarlosperate:masterfrom
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.