-
-
Save Dicetog/a36dc83c0c817bb22cce to your computer and use it in GitHub Desktop.
Bone101 Tutorial
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 style="font-size: 1.1em; line-height: 1.3em; color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif;">Write a <a href="http://beagleboard.org/Support/BoneScript/#HIGH" style="color: rgb(222, 114, 36);">HIGH</a> or <a href="http://beagleboard.org/Support/BoneScript/#LOW" style="color: rgb(222, 114, 36);">LOW</a> to a digital I/O pin.</p><p style="font-size: 1.1em; line-height: 1.3em; color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif;">NOTE: The 4 USRx LEDs are all able to operate as digital output pins, giving you an always-available output to test your software.</p><h2 style="font-size: 1.5em; font-family: Arial, Verdana, Helvetica, sans-serif; color: rgb(180, 162, 121); margin: 5px 0px; line-height: normal;">Arguments</h2><ul style="color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px;"><li><em>pin</em>: the <a href="http://beagleboard.org/Support/BoneScript/#pin" style="color: rgb(222, 114, 36);">BeagleBone pin</a> identifier</li><li><em>value</em>: the logic level to set the pin</li><li><em>callback</em>: called upon completion</li></ul><h2 style="font-size: 1.5em; font-family: Arial, Verdana, Helvetica, sans-serif; color: rgb(180, 162, 121); margin: 5px 0px; line-height: normal;">Return value</h2><ul style="color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px;"><li><a href="http://beagleboard.org/Support/BoneScript/#true" style="color: rgb(222, 114, 36);">true</a> if successful</li><li><a href="http://beagleboard.org/Support/BoneScript/#false" style="color: rgb(222, 114, 36);">false</a> on failure</li></ul><h2 style="font-size: 1.5em; font-family: Arial, Verdana, Helvetica, sans-serif; color: rgb(180, 162, 121); margin: 5px 0px; line-height: normal;">callback(x)</h2><ul style="color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px;"><li><em>x.err</em>: error status message</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
<h2 style="font-size: 1.5em; font-family: Arial, Verdana, Helvetica, sans-serif; color: rgb(180, 162, 121); margin: 5px 0px; line-height: normal;">Build and execute instructions</h2><h2 style="font-size: 1.5em; font-family: Arial, Verdana, Helvetica, sans-serif; color: rgb(180, 162, 121); margin: 5px 0px; line-height: normal;"><img align="right" width="50%" src="http://beagleboard.org/static/uploads/LEDs.PNG" style="color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px;"><ul style="color: rgb(82, 82, 82); font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px;"><li>The USR0 LED is built in, so no circuit assembly is required.</li><li>Look for it to go high when you run the example code.</li><li>Alter the code to set it low and run it again.</li></ul></h2> |
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'); | |
b.pinMode('USR0', b.OUTPUT); | |
b.digitalWrite('USR0', b.HIGH); |
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'); | |
b.pinMode('USR0', b.OUTPUT); | |
b.digitalWrite('USR0', b.LOW); |
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
<span style="font-weight: bold;">digitalWrite(pin, value, [callback])</span><div>The digitalWrite function, writes a HIGH or LOW to a digital I/O pin.</div><div><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ5RIqUaRRNmT801sTv6rf-cwpz9qfzj5w4XEzR2YaUsJajXmRN" style="width: 80px;"><br></div> |
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
Preview Card 1 | |
Explanation | |
Build and execute instructions | |
Example High | |
Example Low |
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'); | |
b.pinMode('USR0', b.OUTPUT); | |
b.digitalWrite('USR0', b.HIGH); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment