Projects update: add Obsolete flag
[beagleboard.org.git] / db / 2806.xml
blobe388604fe28499a03da9647a9fbeda3ece4e7d4b
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="2806" name="demo_blinkled_external" prototype="Page" created="1372219442081" lastModified="1387490194895">
5   <hop:parent idref="2471" prototyperef="Page"/>
6     <is_xhtml type="boolean">true</is_xhtml>
7     <http_remotehost>192.91.75.29</http_remotehost>
8     <http_language>en-US,en;q=0.8,fr;q=0.6</http_language>
9     <uri>demo_blinkled_external</uri>
10     <http_browser>Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36</http_browser>
11     <time type="date">19.12.2013 15:56:34 CST</time>
12     <hopsession>192.91.75.yfl0dmkzwh07</hopsession>
13     <body>&lt;script src=&quot;/static/bonescript-demo.js&quot;&gt;&lt;/script&gt;\r
14 &lt;div id=&apos;side-menu&apos; class=&quot;t3_sidebar&quot;&gt;\r
15  &lt;ul class=&quot;left-menu&quot;&gt;\r
16   &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;\r
21 &lt;div id=&apos;connect-status&apos;&gt;&lt;/div&gt;\r
22 &lt;div id=&quot;content_child&quot;&gt;\r
24 &lt;h1&gt;Demo: Blink an external LED&lt;/h1&gt;\r
25 &lt;h2&gt;Code\r
26  &lt;button class=&quot;dynlink&quot; onclick=&quot;demoRun(&apos;code&apos;)&quot;&gt;run&lt;/button&gt;\r
27  &lt;button class=&quot;dynlink&quot; onclick=&quot;demoRestore(&apos;code&apos;)&quot;&gt;restore&lt;/button&gt;\r
28 &lt;/h2&gt;\r
29 &lt;pre id=&apos;code&apos; class=&apos;use-editor&apos; style=&apos;height:280px;&apos;&gt;\r
30 var b = require(&apos;bonescript&apos;);\r
31 var led = &quot;P8_13&quot;;\r
32 var state = 0;\r
34 b.pinMode(led, &apos;out&apos;);\r
35 toggleLED = function() {\r
36     state = state ? 0 : 1;\r
37     b.digitalWrite(led, state);\r
38 };\r
40 timer = setInterval(toggleLED, 100);\r
42 stopTimer = function() {\r
43     clearInterval(timer);\r
44 };\r
46 setTimeout(stopTimer, 30000);&lt;/pre&gt;\r
47 &lt;div readonly id=&apos;console-output&apos; style=&apos;height:80px;&apos;&gt;&lt;/div&gt;\r
48 &lt;h2&gt;Build and execute instructions&lt;/h2&gt;\r
49 &lt;img align=&quot;right&quot; width=&quot;50%&quot; src=&quot;http://beagleboard.org/static/uploads/Demo%20Blinked.PNG&quot; /&gt;\r
50 &lt;ul&gt;\r
51     &lt;li&gt;Connect an LED and resistor as shown being sure to get the anode/cathode orientation correct.&lt;/li&gt;\r
52     &lt;li&gt;Run the example code and observe the blinking.&lt;/li&gt;\r
53     &lt;li&gt;Alter the frequency and re-run the example.&lt;/li&gt;\r
54 &lt;/ul&gt;\r
55 &lt;h2&gt;See also&lt;/h2&gt;\r
56 &lt;h3&gt;Topics&lt;/h3&gt;\r
57 &lt;ul&gt;\r
58  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#headers&quot;&gt;BeagleBone expansion headers&lt;/a&gt;&lt;/li&gt;\r
59  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#digitalio&quot;&gt;Digital I/O&lt;/a&gt;&lt;/li&gt;\r
60  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#timers&quot;&gt;Timers&lt;/a&gt;&lt;/li&gt;\r
61 &lt;/ul&gt;\r
62 &lt;h3&gt;Related functions&lt;/h3&gt;\r
63 &lt;ul&gt;\r
64  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/#require&quot;&gt;require&lt;/a&gt;&lt;/li&gt;\r
65  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/pinMode&quot;&gt;pinMode&lt;/a&gt;&lt;/li&gt;\r
66  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/digitalWrite&quot;&gt;digitalWrite&lt;/a&gt;&lt;/li&gt;\r
67 &lt;/ul&gt;\r
68 &lt;h3&gt;Examples&lt;/h3&gt;\r
69 &lt;ul&gt;\r
70  &lt;li&gt;&lt;a href=&quot;/Support/BoneScript/demo_blinkled&quot;&gt;Blink an on-board LED&lt;/a&gt;&lt;/li&gt;\r
71 &lt;/ul&gt;\r
73 &lt;h3&gt;Where to buy&lt;/h3&gt;\r
74 &lt;ul&gt;\r
75  &lt;li&gt;&lt;a href=&quot;http://elinux.org/CircuitCo:BeagleBone_Breadboard#Distributors&quot;&gt;BreadBoard&lt;/a&gt;&lt;/li&gt;\r
76   &lt;li&gt;&lt;a href=&quot;https://www.sparkfun.com/products/9590&quot;&gt;External LED&lt;/a&gt;&lt;/li&gt;\r
77    &lt;li&gt;&lt;a href=&quot;https://www.sparkfun.com/products/11026&quot;&gt;Jumper wires&lt;/a&gt;&lt;/li&gt;\r
78     &lt;li&gt;&lt;a href=&quot;https://www.sparkfun.com/search/products?sort_by=relevance%7Casc&amp;per_page=500&amp;term=resistor&quot;&gt;Resistors&lt;/a&gt;&lt;/li&gt;\r
79  &lt;/ul&gt;\r
80 &lt;/div&gt;\r
81 &lt;/div&gt;\r
82 &lt;div style=&quot;clear:both; padding-left: 213px;&quot;&gt;&lt;h2&gt;See it in action&lt;/h2&gt;\r
83 &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/kmctGc_JALc&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;\r
84 </body>
85     <pseudoparent idref="2471" prototyperef="Page"/>
86     <http_referer>http://beagleboard.org/support/BoneScript/demo_blinkled_external/edit</http_referer>
87     <http_host>beagleboard.org</http_host>
88     <user>jessica.lynne.callaway@gmail.com</user>
89     <lang>en-us</lang>
90   </hopobject>
91 </xmlroot>