Created
June 30, 2015 13:27
-
-
Save DiegoTc/5cffc9f94f8a61daffad to your computer and use it in GitHub Desktop.
title: Led on!, description: Let's Turn on led number one!
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
| var b = require('bonescript'); | |
| var led = "USR3"; | |
| var state = 0; | |
| b.pinMode(led, 'out'); | |
| toggleLED = function() { | |
| state = state ? 0 : 1; | |
| b.digitalWrite(led, state); | |
| }; | |
| timer = setInterval(toggleLED, 100); | |
| stopTimer = function() { | |
| clearInterval(timer); | |
| }; | |
| setTimeout(stopTimer, 3000); |
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
| <h2>Build and execute instructions</h2> | |
| <p> </p> | |
| <ul> | |
| <li>Run the example code and observe USR3 blinking.</li> | |
| <li>Alter the frequency and re-run the example.</li> | |
| </ul> |
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
| <p>Hope this works!</p> |
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
| <p>sdsd</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment