Web edits
[beagleboard.org.git] / db / 2471.xml
blob508735107ee815d0291b37418eecf1df88a1889d
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <?xml-stylesheet type="text/xsl" href="helma.xsl"?>
3 <xmlroot xmlns:hop="http://www.helma.org/docs/guide/features/database">
4   <hopobject id="2471" name="BoneScript" prototype="Page" created="1366427239709" lastModified="1386722178681">
5   <hop:parent idref="121" prototyperef="Page"/>
6     <is_xhtml type="boolean">true</is_xhtml>
7     <http_remotehost>68.43.104.104</http_remotehost>
8     <http_language>en-US,en;q=0.8</http_language>
9     <uri>BoneScript</uri>
10     <http_browser>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36</http_browser>
11     <time type="date">10.12.2013 18:36:18 CST</time>
12     <hopsession>68.43.104.occnfohvio7s</hopsession>
13     <body>&lt;script src=&quot;/static/bonescript-demo.js&quot;&gt;&lt;/script&gt;\r
14 &lt;/br&gt;\r
15 &lt;div id=&apos;side-menu&apos; class=&quot;t3_sidebar&quot;&gt;\r
16     &lt;ul class=&quot;left-menu&quot;&gt;&lt;strong&gt;Navigation&lt;/strong&gt;\r
17         &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/menu/&quot;&gt;Menu contents&lt;/a&gt;&lt;/li&gt;\r
18     &lt;/ul&gt;\r
19 &lt;/div&gt;\r
20 &lt;div class=&quot;t3_content_1&quot;&gt;&lt;div id=&apos;connect-status&apos;&gt;&lt;/div&gt;&lt;div id=&quot;content_child&quot;&gt;\r
21 &lt;h1&gt;BoneScript Library&lt;/h1&gt;\r
22 &lt;p&gt;BoneScript is a &lt;a href=&quot;http://nodejs.org&quot; class=&quot;External&quot;&gt;Node.js&lt;/a&gt; library specifically \r
23 optimized for the Beagle family\r
24 and featuring familiar Arduino function calls, exported to the browser. Get \r
25 started exploring the BoneScript Library to discover the great simplicity \r
26 that is made possible by utilizing Linux.&lt;/p&gt;\r
27 &lt;h2&gt;References&lt;/h2&gt;\r
28 &lt;h3&gt;Web-based learning&lt;/h3&gt;\r
29 &lt;ul&gt;\r
30     &lt;li&gt;&lt;a href=&quot;http://www.nodejs.org/docs/v0.8.22/api/&quot; class=&quot;external&quot;&gt;Node.JS API reference&lt;/a&gt;&lt;/li&gt;\r
31     &lt;li&gt;&lt;a href=&quot;http://www.w3schools.com/js/default.asp&quot; class=&quot;external&quot;&gt;W3Schools JavaScript tutorial&lt;/a&gt;&lt;/li&gt;\r
32     &lt;li&gt;&lt;a href=&quot;http://khanacademy.org/cs/programming&quot; class=&quot;external&quot;&gt;Khan Academy&lt;/a&gt;&lt;/li&gt;\r
33 &lt;/ul&gt;\r
34 &lt;h3&gt;Books&lt;/h3&gt;\r
35 &lt;ul&gt;\r
36 &lt;li&gt;&lt;a href=&quot;/bad-to-the-bone&quot;&gt;Bad to the Bone: Crafting Electronics Systems \r
37 with BeagleBone and BeagleBone Black&lt;/a&gt; (&lt;a \r
38 href=&quot;http://www.amazon.com/dp/1627051376/?tag=bloghanerhead-20&quot; Class=&quot;external&quot;&gt;Amazon&lt;/a&gt;)&lt;/li&gt;\r
39 &lt;li&gt;&lt;a href=&quot;http://www.amazon.com/dp/1449345379/?tag=bloghanerhead-20&quot; \r
40 Class=&quot;external&quot;&gt;Getting Started with BeagleBone&lt;/a&gt;&lt;/li&gt; \r
41 &lt;li&gt;&lt;a href=&quot;http://www.amazon.com/dp/1449398588/?tag=bloghanerhead-20&quot; \r
42 Class=&quot;external&quot;&gt;Node: Up and Running&lt;/a&gt;&lt;/li&gt; \r
43 &lt;/ul&gt;\r
45 &lt;h2 id=&quot;functions&quot;&gt;Functions&lt;/h2&gt;\r
46  &lt;p&gt;The BoneScript library provides several functions useful for interacting\r
47  with your hardware. Browse the menu to the left for examples to get you \r
48  started.&lt;/p&gt;\r
50  &lt;h2 id=&quot;javascript&quot;&gt;JavaScript&lt;/h2&gt;\r
51  &lt;p&gt;Performing physical computing tasks in JavaScript is a rather different than\r
52     C on microcontrollers.  JavaScript and the\r
53   Node.JS interpreter like to do everything asynchronously using callbacks.  \r
54   An event loop runs waiting on whatever the next\r
55   system-blocking event is, such as waiting for a keypress or a file \r
56   load to complete.  The callbacks are then executed\r
57   to completion before other event handlers are run.\r
58   &lt;/p&gt;\r
59   &lt;h3 id=&quot;timers&quot;&gt;Timers&lt;/h3&gt;\r
60   &lt;p&gt;Timing operations in JavaScript are provided by setting timers with \r
61   callback event handlers.  A nice overview of\r
62   JavaScript timers can be found on &lt;a \r
63   href=&quot;http://www.w3schools.com/js/js_timing.asp&quot; target=&quot;_blank&quot; \r
64   class=&quot;external&quot;&gt;www.w3schools.com&lt;/a&gt;.&lt;/p&gt;\r
65   &lt;ul&gt;\r
66    &lt;li&gt;var timer = setTimeout(callback, milliseconds)&lt;/li&gt;\r
67    &lt;li&gt;clearTimeout(timer)&lt;/li&gt;\r
68    &lt;li&gt;var timer = setInterval(callback, milliseconds)&lt;/li&gt;\r
69    &lt;li&gt;clearInterval(timer)&lt;/li&gt;\r
70   &lt;/ul&gt;\r
71  &lt;h3 id=&quot;libraries&quot;&gt;Libraries&lt;/h3&gt;\r
72  &lt;p&gt;The BoneScript Library runs in Node.JS.  You can run it\r
73  directly on the board using the &apos;node&apos; interpreter or the Cloud9 IDE that \r
74  invokes the &apos;node&apos; interpreter.  You can\r
75  also run it using the &lt;a href=&quot;/bonescript.js&quot;&gt;bonescript.js&lt;/a&gt; script \r
76  within your browser via remote procedure calls\r
77  using Socket.io and served up by the web server running on your Beagle.&lt;/p&gt;\r
78  &lt;p id=&quot;require&quot;&gt;Access to the library functions is provided through the \r
79  &quot;require(&apos;bonescript&apos;)&quot; function call.  The\r
80  call returns an object containing all of the functions and constants \r
81  exported by the library.  The Node.JS API documentation\r
82  on &lt;a href=&quot;http://www.nodejs.org/docs/v0.8.22/api/modules.html&quot; \r
83  target=&quot;_blank&quot; class=&quot;External&quot;&gt;modules&lt;/a&gt; provides more information on the usage\r
84  of &apos;require&apos; within the &apos;node&apos; interpreter.&lt;/p&gt;\r
85   &lt;h3&gt;Other JavaScript topics&lt;/h3&gt;\r
86   &lt;p id=&quot;console&quot;&gt;The Chrome browser has a rather nice JavaScript debugger you \r
87   can use to examine your code.  You might\r
88   also get good benefit out of &apos;console.log()&apos;.&lt;/p&gt;\r
89   &lt;p id=&quot;typeof&quot;&gt;Because JavaScript is dynamically typed, you might find the \r
90   &apos;typeof operator&apos; rather useful to determine\r
91   the type of a variable at run-time.  A nice overview of the JavaScript typeof \r
92   operator can be found at \r
93   &lt;a target=&quot;_blank&quot; \r
94   href=&quot;https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/typeof&quot; \r
95   class=&quot;external&quot;&gt;\r
96       developer.mozilla.org&lt;/a&gt;.&lt;/p&gt;\r
99 &lt;h3&gt;Resources&lt;/h3&gt;\r
100 &lt;a id=&quot;console&quot;&gt;&lt;/a&gt;\r
101 &lt;a id=&quot;typeof&quot;&gt;&lt;/a&gt;\r
102 &lt;p&gt;To learn more about Cloud9 IDE and to synchronize the software on your board \r
103 with cloud-hosted services, see\r
104   &lt;a target=&quot;_blank&quot; href=&quot;http://c9.io&quot;&gt;www.c9.io&lt;/a&gt;.&lt;/p&gt;\r
105 &lt;p&gt;For more information on Node.JS, the JavaScript interpreter, see &lt;a \r
106 target=&quot;_blank&quot; href=&quot;http://nodejs.org&quot; class=&quot;external&quot;&gt;www.nodejs.org&lt;/a&gt;.\r
107   You can find the api documentation\r
108   at &lt;a target=&quot;_blank&quot; href=&quot;http://nodejs.org/docs/v0.8.22/api&quot; \r
109   class=&quot;external&quot;&gt;www.nodejs.org/docs/v0.8.22/api&lt;/a&gt;.\r
110 &lt;/p&gt;\r
111 &lt;p&gt;The source code for BoneScript is hosted at \r
112 &lt;a href=&quot;https://github.com/jadonk/bonescript&quot;&gt;Github.com/jadonk/bonescript&lt;/a&gt;.&lt;/p&gt;\r
113  \r
114 &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;</body>
115     <pseudoparent idref="121" prototyperef="Page"/>
116     <http_referer>http://beagleboard.org/support/BoneScript/edit</http_referer>
117     <http_host>beagleboard.org</http_host>
118     <user>jkridner@gmail.com</user>
119     <lang>en-us</lang>
120     <hop:child idref="2477" prototyperef="Page"/>
121     <hop:child idref="2478" prototyperef="Page"/>
122     <hop:child idref="2479" prototyperef="Page"/>
123     <hop:child idref="2563" prototyperef="Page"/>
124     <hop:child idref="2564" prototyperef="Page"/>
125     <hop:child idref="2607" prototyperef="Page"/>
126     <hop:child idref="2640" prototyperef="Page"/>
127     <hop:child idref="2737" prototyperef="Page"/>
128     <hop:child idref="2738" prototyperef="Page"/>
129     <hop:child idref="2768" prototyperef="Page"/>
130     <hop:child idref="2769" prototyperef="Page"/>
131     <hop:child idref="2779" prototyperef="Page"/>
132     <hop:child idref="2780" prototyperef="Page"/>
133     <hop:child idref="2781" prototyperef="Page"/>
134     <hop:child idref="2782" prototyperef="Page"/>
135     <hop:child idref="2783" prototyperef="Page"/>
136     <hop:child idref="2784" prototyperef="Page"/>
137     <hop:child idref="2785" prototyperef="Page"/>
138     <hop:child idref="2798" prototyperef="Page"/>
139     <hop:child idref="2805" prototyperef="Page"/>
140     <hop:child idref="2806" prototyperef="Page"/>
141     <hop:child idref="2808" prototyperef="Page"/>
142     <hop:child idref="2809" prototyperef="Page"/>
143     <hop:child idref="2814" prototyperef="Page"/>
144     <hop:child idref="2819" prototyperef="Page"/>
145     <hop:child idref="2825" prototyperef="Page"/>
146     <hop:child idref="2836" prototyperef="Page"/>
147     <hop:child idref="2891" prototyperef="Page"/>
148     <hop:child idref="2892" prototyperef="Page"/>
149     <hop:child idref="2894" prototyperef="Page"/>
150     <hop:child idref="2993" prototyperef="Page"/>
151     <hop:child idref="2994" prototyperef="Page"/>
152     <hop:child idref="2995" prototyperef="Page"/>
153     <hop:child idref="3004" prototyperef="Page"/>
154     <hop:child idref="3016" prototyperef="Page"/>
155     <hop:child idref="3176" prototyperef="Page"/>
156     <hop:child idref="3277" prototyperef="Page"/>
157   </hopobject>
158 </xmlroot>