Permalink
Browse files

oscon: WIP

  • Loading branch information...
1 parent 84c7bfa commit 664a6b3468146900fcc26f56681d564f4547ba6b @jadonk committed Jul 18, 2012
Showing with 35 additions and 26 deletions.
  1. +2 −1 bone101/client.js
  2. +32 −12 bone101/index.html
  3. +1 −11 bone101/js_term.html
  4. +0 −2 bone101/oscon.css
View
@@ -1,7 +1,8 @@
var cssUrls = [
'/schmux.css',
'/jquery.terminal.css', // http://terminal.jcubic.pl/js/jquery.terminal.css
- '/jquery-ui.css' // http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css
+ '/jquery-ui.css', // http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css
+ '/client.css'
];
var scriptUrls = [
View
@@ -174,27 +174,47 @@ <h2 style="margin-left: 1em;">Simplified Physical Computing with Node.JS</h2>
</div>
<div class="slide">
- <h1>Analog signals can be input and generated via analogRead/analogWrite<h1>
- <h2>&nbsp;</h2>
+ <h1>analogRead/analogWrite<h1>
+ <h2>Use ADCs and PWMs to read/write analog values</h2>
+ <p>Monitor analog in: <span class="dynlink" onclick="eval(document.getElementById('analogWrite2').innerHTML)">
+ run</span></p>
+ <pre id="analogWrite2">
+pinMode(bone.P8_13, 'out', 4);
+addLoop(function() {
+ var value = analogRead(bone.P9_36);
+ analogWrite(bone.P8_13, value);
+}, 25, doAlert);</pre>
+ <p>Fade in and out: <span class="dynlink" onclick="eval(document.getElementById('analogWrite3').innerHTML)">
+ run</span></p>
+ <pre id="analogWrite3">
+ pinMode(bone.P8_13, 'out', 4);
+ addLoop(function() {
+ if(!this.awDirection) { this.awValue = 0.01; this.awDirection = 1; }
+ analogWrite(bone.P8_13, this.awValue);
+ this.awValue = this.awValue + (this.awDirection*0.01);
+ if(this.awValue > 1.0) { this.awValue = 1.0; this.awDirection = -1; }
+ else if(this.awValue <= 0.01) { this.awValue = 0.01; this.awDirection = 1; }
+ }, 100, doAlert);</pre>
+ <p>Halt all loops: <span class="dynlink" onclick="eval(document.getElementById('analogWrite4').innerHTML)">
+ run</span></p>
+ <pre id="analogWrite4">
+ getLoops(function(loops){for(var loop in loops.loops){removeLoop(loop, doAlert);}});</pre>
+ </div>
+
+ <div class="slide">
+ <h1>analogRead/analogWrite<h1>
+ <h2>Use ADCs and PWMs to read/write analog values</h2>
<p>Please connect P8-13 to LED through 1khom resistor</p>
<div id="slider1"></div>
<p>Attach to slider: <span class="dynlink" onclick="eval(document.getElementById('analogWrite1').innerHTML)">
run</span></p>
<pre id="analogWrite1">
pinMode(bone.P8_13, 'out', 4);
-$("slider1").bind("slidechange", function(event, ui){
+$("#slider1").bind("slidechange", function(event, ui) {
analogWrite(bone.P8_13, ui.value/100.0);
})</pre>
- <p>Fade in and out: <span class="dynlink" onclick="eval(document.getElementById('analogWrite2').innerHTML)">
- run</span></p>
- <pre id="analogWrite2">
-pinMode(bone.P8_13, 'out', 4);
-addLoop(function() {
- var value = analogRead(bone.P9_36);
- analogWrite(bone.P8_13, value);
-}, 25, doAlert);
</div>
-
+
<div class="slide">
<h1>Cloud9 experience<h1>
</div>
View
@@ -7,22 +7,12 @@
<script src="client.js" charset="utf-8" type="text/javascript"></script>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
- <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
- <style type="text/css">
- #slider { margin: 10px; }
- </style>
- <script>
- $(document).ready(function() {
- $("#slider").slider();
- });
- </script>
<body>
<div class="slide">
<h1>JavaScript terminal</h1>
<h2>&nbsp;</h2>
<canvas id="canvas1"></canvas>
- <div id="slider"></div>
+ <div id="slider1"></div>
<div id="js_term"></div>
</div>
</body>
View
@@ -580,5 +580,3 @@ pre {
color: black;
background-color: DDC082;
}
-
-#slider1 { margin: 10px; }

0 comments on commit 664a6b3

Please sign in to comment.