<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Assignment 6 &#8211; Making Things Interactive</title>
	<atom:link href="https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;cat=13" rel="self" type="application/rss+xml" />
	<link>https://courses.ideate.cmu.edu/48-339/s2018</link>
	<description>48-339/739 Spring 2018</description>
	<lastBuildDate>Sun, 08 Jul 2018 18:34:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.2.20</generator>
	<item>
		<title>Assignment Six</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=462</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=462#respond</comments>
				<pubDate>Thu, 01 Mar 2018 23:51:37 +0000</pubDate>
		<dc:creator><![CDATA[mcherban@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=462</guid>
				<description><![CDATA[setPixelColor For this assignment, I wanted to further explore the serial protocol between p5.js and Arduino. Specifically, how to send more complex information from p5 (long strings) and read multiple values on the Arduino. I created a sketch that acts as a NeoPixel color picker where you can slide along and set the color, then &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=462" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment Six"</span></a>]]></description>
								<content:encoded><![CDATA[<h4>setPixelColor</h4>
<p>For this assignment, I wanted to further explore the serial protocol between p5.js and Arduino. Specifically, how to send more complex information from p5 (long strings) and read multiple values on the Arduino. I created a sketch that acts as a NeoPixel color picker where you can slide along and set the color, then click on the corresponding box to light that exact NeoPixel on the Arduino.</p>
<p>***This project will be updated shortly to include gyro sensor***</p>
<p><img class="alignnone wp-image-464" src="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/03/assignment06_fritzing-300x121.jpg" alt="" width="712" height="287" srcset="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/03/assignment06_fritzing-300x121.jpg 300w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/03/assignment06_fritzing-768x309.jpg 768w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/03/assignment06_fritzing.jpg 1000w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></p>
<p><iframe src="https://player.vimeo.com/video/258181668?app_id=122963" width="840" height="690" frameborder="0" title="setPixelColor" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></p>
<h5>Arduino Code:</h5>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">//--------NEOPIXEL SETUP --------<br />
#include <br />
#ifdef __AVR__<br />
#include <br />
#endif<br />
static const int PIN = 3;<br />
static const int NUMPIXELS = 7;<br />
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);<br />
<br />
static const int buttonPin = 4;<br />
int buttonState = 1;<br />
<br />
//-----STRING TEST-----<br />
int pos1; // comma one<br />
int pos2; // comma two<br />
int pos3; // comma three<br />
int r;<br />
int g;<br />
int b;<br />
<br />
//-----INCOMING VALUES-----<br />
String incomingString; // setting string from p5.js <br />
<br />
//-----OUTGOING-------<br />
String sendState;<br />
<br />
//--------TIME--------<br />
unsigned long lastSampleTime = 0;<br />
unsigned long sampleInterval = 500; // in ms<br />
<br />
void setup() {<br />
&nbsp; // put your setup code here, to run once:<br />
&nbsp; Serial.begin(115200);<br />
&nbsp; pinMode(buttonPin, INPUT);<br />
<br />
&nbsp; pixels.begin();<br />
&nbsp; pixels.show();<br />
}<br />
<br />
void loop() {<br />
&nbsp; unsigned long now = millis();<br />
<br />
&nbsp; if (Serial.available() &amp;gt; 0) {<br />
&nbsp; &nbsp; // &quot;A,100,20,5&quot; ADD COMMENTS<br />
&nbsp; &nbsp; incomingString = Serial.readStringUntil('\n'); // takes the incoming string sent from p5 and puts into incomingString<br />
<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; pos1 = incomingString.indexOf(&quot;,&quot;);<br />
&nbsp; &nbsp; pos2 = incomingString.indexOf(&quot;,&quot;, pos1 + 1);<br />
&nbsp; &nbsp; pos3 = incomingString.indexOf(&quot;,&quot;, pos2 + 1);<br />
&nbsp; &nbsp; String letter = incomingString.substring(0, pos1);<br />
&nbsp; &nbsp; String red = incomingString.substring(pos2, pos1 + 1);<br />
&nbsp; &nbsp; r = red.toInt();<br />
&nbsp; &nbsp; String green = incomingString.substring(pos3, pos2 + 1);<br />
&nbsp; &nbsp; g = green.toInt();<br />
&nbsp; &nbsp; String blue = incomingString.substring(pos3 + 1);<br />
&nbsp; &nbsp; b = blue.toInt();<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; if (letter == &quot;A&quot;) { // LED POSITION 1<br />
&nbsp; &nbsp; &nbsp; pON(0, g, r, b); // 1<br />
&nbsp; &nbsp; } else if (letter == &quot;B&quot;) { // LED POSITION 2<br />
&nbsp; &nbsp; &nbsp; pON(1, g, r, b); // 2<br />
&nbsp; &nbsp; } else if (letter == &quot;C&quot;) { // LED POSITION 3<br />
&nbsp; &nbsp; &nbsp; pON(2, g, r, b); // 3<br />
&nbsp; &nbsp; } else if (letter == &quot;D&quot;) { // LED POSITION 4<br />
&nbsp; &nbsp; &nbsp; pON(3, g, r, b); // 4<br />
&nbsp; &nbsp; } else if (letter == &quot;E&quot;) { // LED POSITION 5<br />
&nbsp; &nbsp; &nbsp; pON(4, g, r, b); // 5<br />
&nbsp; &nbsp; } else if (letter == &quot;F&quot;) { // LED POSITION 6<br />
&nbsp; &nbsp; &nbsp; pON(5, g, r, b); // 6<br />
&nbsp; &nbsp; } else if (letter == &quot;G&quot;) { // LED POSITION 7<br />
&nbsp; &nbsp; &nbsp; pON(6, g, r, b); // 7<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
}<br />
<br />
<br />
void pOFF(int n) {<br />
&nbsp; pixels.setPixelColor(n, pixels.Color(0, 0, 0));<br />
&nbsp; pixels.show();<br />
&nbsp; delay(2000);<br />
&nbsp; // pixelOff = true;<br />
}<br />
<br />
void pON(int n, int g, int r, int b) {<br />
&nbsp; pixels.setPixelColor(n, pixels.Color(g, r, b));<br />
&nbsp; pixels.show();<br />
&nbsp; // pixelOn = true;<br />
}</div></div>
<h5>p5 Code:</h5>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">// color picker based on jasmine c. lee's sketch https://gist.github.com/jasmineclee/86236bc2bd16cb279b52<br />
<br />
//-----SERIAL VARIABLES-----<br />
var serial;<br />
var portName = '/dev/cu.usbmodem1411';<br />
<br />
//-----WINDOW DIMENSIONS-----<br />
var windW = 600;<br />
var windH = 400;<br />
<br />
//-----Color Picker-----<br />
var x; // where the spectrum starts (X)<br />
var y; // where the spectrum starts (Y)<br />
var end; // where the spectrum ends (X)<br />
var totalWidth; // width of the spectrum<br />
var totalHeight; // height of the spectrum<br />
var incStart; // setting where the incrementing values will start, using X, but this will NOT change<br />
<br />
//-----Color Values-----<br />
var rd;<br />
var gr;<br />
var bl;<br />
<br />
//-----Picker Variables-----<br />
var colChange;<br />
var colRecWidth = 1;<br />
<br />
// array of colors in spectrum<br />
var colorAtTime;<br />
var array;<br />
var arrayR;<br />
var arrayG;<br />
var arrayB;<br />
<br />
// the colors at the specific time (what you're hovering over)<br />
var rNow;<br />
var gNow;<br />
var bNow;<br />
var colNow;<br />
<br />
// the colors you've selected<br />
var rChoice;<br />
var gChoice;<br />
var bChoice;<br />
<br />
// setting up LED boxes<br />
var squares = [];<br />
var counter = 1;<br />
<br />
var latestData;<br />
<br />
function setup() {<br />
&nbsp; //-----Serial Setup-----<br />
&nbsp; serial = new p5.SerialPort();<br />
&nbsp; serial.on('list', printList);<br />
&nbsp; serial.on('connected', serverConnected);<br />
&nbsp; serial.on('open', portOpen);<br />
&nbsp; serial.on('data', gotData);<br />
&nbsp; serial.on('error', serialError);<br />
&nbsp; serial.on('close', portClose);<br />
<br />
&nbsp; serial.list();<br />
&nbsp; serial.open(portName);<br />
&nbsp; //----------------------<br />
<br />
&nbsp; createCanvas(windW, windH);<br />
&nbsp; smooth();<br />
&nbsp; background(245);<br />
<br />
&nbsp; x = 100; // where the spectrum starts on X<br />
&nbsp; y = 250; // where the spectrum starts on Y<br />
&nbsp; end = windW - x; // where the spectrum ends (y)<br />
&nbsp; totalWidth = windW - x*2;<br />
&nbsp; totalHeight = 75;<br />
<br />
&nbsp; incStart = x;<br />
<br />
&nbsp; rd = 255;<br />
&nbsp; gr = 0;<br />
&nbsp; bl = 0;<br />
<br />
&nbsp; rChoice = 0;<br />
&nbsp; gChoice = 0;<br />
&nbsp; bChoice = 0;<br />
<br />
&nbsp; array = [rd + &quot;, &quot; + gr + &quot;, &quot; + bl];<br />
&nbsp; arrayR = [rd];<br />
&nbsp; arrayG = [gr];<br />
&nbsp; arrayB = [bl];<br />
<br />
&nbsp; // initial text at the top (where your color's RGB will be)<br />
&nbsp; push();<br />
&nbsp; textSize(20);<br />
&nbsp; textAlign(CENTER);<br />
&nbsp; noStroke();<br />
&nbsp; text(&quot;NeoPixel Color Picker&quot;, windW / 2, 50);<br />
&nbsp; pop();<br />
<br />
&nbsp; for (var i = 0; i &nbsp;y &amp;amp;&amp;amp; mouseY = incStart &amp;amp;&amp;amp; mouseX &amp;lt;= incStart + totalWidth) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; push();<br />
&nbsp; &nbsp; &nbsp; &nbsp; fill(245);<br />
&nbsp; &nbsp; &nbsp; &nbsp; noStroke();<br />
&nbsp; &nbsp; &nbsp; &nbsp; rect(0, y - 30, windW, 32);<br />
&nbsp; &nbsp; &nbsp; &nbsp; stroke(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; strokeWeight(1.5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; line(mouseX, y - 20, mouseX, y + 1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; fill(rNow, gNow, bNow);<br />
&nbsp; &nbsp; &nbsp; &nbsp; ellipse(mouseX, y - 20, 15, 15);<br />
&nbsp; &nbsp; &nbsp; &nbsp; noFill();<br />
&nbsp; &nbsp; &nbsp; &nbsp; rect(incStart, y + 2, totalWidth, totalHeight - 2);<br />
&nbsp; &nbsp; &nbsp; &nbsp; pop();<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
// function for whole color picker spectrum; increments represent the six segments of color changing<br />
function colorPicker(increment1, increment2, increment3, increment4, increment5, increment6) {<br />
&nbsp; colChange = 4; // 3.825;<br />
<br />
&nbsp; while (x = increment1 &amp;amp;&amp;amp; x = increment2 &amp;amp;&amp;amp; x = increment3 &amp;amp;&amp;amp; x = increment4 &amp;amp;&amp;amp; x = increment5 &amp;amp;&amp;amp; x &nbsp;200 &amp;amp;&amp;amp; mouseX = 100 &amp;amp;&amp;amp; mouseY &nbsp;y &amp;amp;&amp;amp; mouseY = incStart &amp;amp;&amp;amp; mouseX &amp;lt; incStart + totalWidth) {<br />
<br />
&nbsp; &nbsp; &nbsp; value = mouseX - 100 // this is to get determine where in the array you are (because at mouseX = 100, you&amp;#039;re at the 0 index of the array)<br />
<br />
&nbsp; &nbsp; &nbsp; rNow = arrayR[value]; // sets the red value of what you&amp;#039;re hovering over, from the array<br />
&nbsp; &nbsp; &nbsp; gNow = arrayG[value]; // sets the green value of what you&amp;#039;re hovering over, from the array<br />
&nbsp; &nbsp; &nbsp; bNow = arrayB[value]; // sets the blue value of what you&amp;#039;re hovering over, from the array<br />
<br />
&nbsp; &nbsp; &nbsp; if (rNow &nbsp;255) { // this is to deal with any math that made the value greater than 255<br />
&nbsp; &nbsp; &nbsp; &nbsp; rNow = 255;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; if (gNow &nbsp;255) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; gNow = 255;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; if (bNow &nbsp;255) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; bNow = 255;<br />
&nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; colNow = array[value];<br />
&nbsp; &nbsp; &nbsp; stroke(255);<br />
&nbsp; &nbsp; &nbsp; //fill(0); // this is here just in case I want to add a darker color option/slider later<br />
&nbsp; &nbsp; &nbsp; // rect(200, height - 200, 100, 25);<br />
&nbsp; &nbsp; &nbsp; fill(rNow, gNow, bNow);<br />
<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
&nbsp; // else{<br />
&nbsp; // &nbsp; fill(255);<br />
&nbsp; // }<br />
&nbsp; // rect(width / 2 - 50, 350, 100, 25); // this creates the rectangle at the bottom (but now, it's filled in w/ the color you're hovering over OR you have selected)<br />
<br />
}<br />
<br />
function mousePressed() {<br />
<br />
&nbsp; // this is to say: if you press on any part of the spectrum, you will make display the selected color at the rectangle AND fill in the rectangle at the bottom<br />
&nbsp; if (mouseX &amp;gt;= incStart &amp;amp;&amp;amp; mouseX &nbsp;y &amp;amp;&amp;amp; mouseY &amp;lt; y + totalHeight) {<br />
&nbsp; &nbsp; &nbsp; push();<br />
&nbsp; &nbsp; &nbsp; fill(245);<br />
&nbsp; &nbsp; &nbsp; noStroke();<br />
&nbsp; &nbsp; &nbsp; rect(0, windH - 70, windW, 100);<br />
&nbsp; &nbsp; &nbsp; pop();<br />
<br />
&nbsp; &nbsp; &nbsp; textSize(18);<br />
&nbsp; &nbsp; &nbsp; noStroke();<br />
&nbsp; &nbsp; &nbsp; fill(0);<br />
&nbsp; &nbsp; &nbsp; text(&amp;quot;R: &amp;quot; + round(rNow), incStart, windH - 50);<br />
&nbsp; &nbsp; &nbsp; text(&amp;quot;G: &amp;quot; + round(gNow), incStart, windH - 33);<br />
&nbsp; &nbsp; &nbsp; text(&amp;quot;B: &amp;quot; + round(bNow), incStart, windH - 16);<br />
<br />
&nbsp; &nbsp; &nbsp; // push();<br />
&nbsp; &nbsp; &nbsp; // fill(0);<br />
&nbsp; &nbsp; &nbsp; // rect(width / 2 - 50, 350, 100, 25);<br />
&nbsp; &nbsp; &nbsp; // fill(rNow, gNow, bNow);<br />
&nbsp; &nbsp; &nbsp; // rect(width / 2 - 50, 350, 100, 25);<br />
&nbsp; &nbsp; &nbsp; // pop();<br />
<br />
&nbsp; &nbsp; &nbsp; // setting the color so that it can be used on the drawing pad<br />
&nbsp; &nbsp; &nbsp; rChoice = round(rNow);<br />
&nbsp; &nbsp; &nbsp; gChoice = round(gNow);<br />
&nbsp; &nbsp; &nbsp; bChoice = round(bNow);<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
<br />
&nbsp; for (var i = 0; i &amp;lt; squares.length; i++) {<br />
&nbsp; &nbsp; squares[i].clicked(mouseX, mouseY,rChoice,gChoice,bChoice);<br />
<br />
&nbsp; }<br />
}<br />
<br />
//-----SERIAL FUNCTIONS-----<br />
<br />
function printList(portList) {<br />
&nbsp; // for (var i = 0; i 5)<br />
&nbsp; &nbsp; &nbsp; &nbsp; // {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; aNum = aString[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; aOff = aString[3];<br />
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; aSize = aString[5];<br />
&nbsp; &nbsp; &nbsp; &nbsp; // }<br />
&nbsp; // console.log(&quot;aNum: &quot; + aNum + &quot;aOff: &quot; + aOff + &quot;aSize: &quot; + aSize);<br />
}<br />
<br />
function serialError(err) {<br />
&nbsp; // print('serialError ' + err);<br />
}<br />
<br />
function portClose() {<br />
&nbsp; // print('portClose');<br />
}</div></div>
<h5>p5 Object Code:</h5>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">function Square(){<br />
&nbsp; this.w = 65;<br />
&nbsp; this.h = 25;<br />
&nbsp; this.col = 200;<br />
<br />
&nbsp; this.display = function(x,y,i){<br />
&nbsp; &nbsp; this.x = x;<br />
&nbsp; &nbsp; this.y = y;<br />
&nbsp; &nbsp; this.index = i;<br />
&nbsp; &nbsp; noStroke();<br />
&nbsp; &nbsp; fill(this.col);<br />
&nbsp; &nbsp; rect(this.x, this.y, this.w, this.h,1.5);<br />
&nbsp; }<br />
<br />
&nbsp; this.clicked = function(px,py, r, g, b){<br />
&nbsp; &nbsp; var sendLED;<br />
&nbsp; &nbsp; var red;<br />
&nbsp; &nbsp; var green;<br />
&nbsp; &nbsp; var blue;<br />
<br />
&nbsp; &nbsp; if (px &amp;gt; this.x &amp;amp;&amp;amp; px &nbsp;this.y &amp;amp;&amp;amp; py &amp;lt; this.y + this.h){<br />
&nbsp; &nbsp; this.col = color(r, g, b);<br />
&nbsp; &nbsp; &nbsp; red = r.toString();<br />
&nbsp; &nbsp; &nbsp; green = g.toString();<br />
&nbsp; &nbsp; &nbsp; blue = b.toString();<br />
<br />
&nbsp; &nbsp; &nbsp; if (this.index == 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;A,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 1) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;B,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 2) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;C,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 3) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;D,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 4) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;E,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 5) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;F,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; } else if (this.index == 6) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; serial.write( &amp;quot;G,&amp;quot; + red + &amp;quot;,&amp;quot; + green + &amp;quot;,&amp;quot; + blue);<br />
<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
}</div></div>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=462</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Assignment 6: Mouse motion based on wire protocol</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=459</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=459#respond</comments>
				<pubDate>Tue, 27 Feb 2018 19:22:00 +0000</pubDate>
		<dc:creator><![CDATA[vkamath@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=459</guid>
				<description><![CDATA[Move an object based on accelerometer movement. I used an ADXL362 and the wire protocol to move an object on the screen. The accelerometer sends the raw XYZ values and a state of a button, the P5Js scripts map the raw acceleration values to areas on the screen. Todo: Need to update the p5js script &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=459" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 6: Mouse motion based on wire protocol"</span></a>]]></description>
								<content:encoded><![CDATA[<p>Move an object based on accelerometer movement. I used an ADXL362 and the wire protocol to move an object on the screen. The accelerometer sends the raw XYZ values and a state of a button, the P5Js scripts map the raw acceleration values to areas on the screen.</p>
<p><strong>Todo</strong>: Need to update the p5js script and improve documentation and add photos.</p>
<p><a href="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/A6_v0.zip">A6_v0</a></p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=459</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Assignment6 &#8211; spatial sensor viz experiment</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=440</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=440#comments</comments>
				<pubDate>Tue, 27 Feb 2018 18:33:00 +0000</pubDate>
		<dc:creator><![CDATA[ditoh@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=440</guid>
				<description><![CDATA[This is a preliminary experiment for my project which aims to visualize sensor network data of a room/building in three dimensions. For this first test, I took temperature data through I2C and visualized particles on Unity that changes the alpha of color depending on the sensor readings. The demo is a bit unintuitive since only &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=440" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment6 &#8211; spatial sensor viz experiment"</span></a>]]></description>
								<content:encoded><![CDATA[<p>This is a preliminary experiment for my project which aims to visualize sensor network data of a room/building in three dimensions. For this first test, I took temperature data through I2C and visualized particles on Unity that changes the alpha of color depending on the sensor readings. The demo is a bit unintuitive since only a single sensor is being used,  but the intention is to take temperature data from each part of a room, manually map the reading location on Unity, and visualize for the entire room.</p>
<p><iframe width="840" height="473" src="https://www.youtube.com/embed/MVpu1_4sJwU?feature=oembed" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>
<p><a href="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Assign6.zip">Assign6-Code</a></p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=440</wfw:commentRss>
		<slash:comments>1</slash:comments>
							</item>
		<item>
		<title>Assignment 6</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=446</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=446#respond</comments>
				<pubDate>Tue, 27 Feb 2018 18:23:50 +0000</pubDate>
		<dc:creator><![CDATA[Rachel Wong]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=446</guid>
				<description><![CDATA[For this assignment, I decided to do another iteration of my assignment 4 light project using Neopixel. I used the same basic GUI with three settings: Sleep, Bathroom, and Movie. The sleep mode is a green light, the bathroom mode is a red light, and the movie mode is a blue light. I only got &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=446" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 6"</span></a>]]></description>
								<content:encoded><![CDATA[<p>For this assignment, I decided to do another iteration of my assignment 4 light project using Neopixel.</p>
<p>I used the same basic GUI with three settings: Sleep, Bathroom, and Movie. The sleep mode is a green light, the bathroom mode is a red light, and the movie mode is a blue light.</p>
<p><img class="alignnone wp-image-448" src="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9170-300x200.jpg" alt="" width="655" height="436" srcset="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9170-300x200.jpg 300w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9170-768x511.jpg 768w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9170-1024x682.jpg 1024w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9170-1200x799.jpg 1200w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /><img class="alignnone wp-image-450" src="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9174-300x200.jpg" alt="" width="599" height="399" srcset="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9174-300x200.jpg 300w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9174-768x511.jpg 768w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9174-1024x682.jpg 1024w, https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/IMG_9174-1200x799.jpg 1200w" sizes="(max-width: 599px) 85vw, 599px" /></p>
<p>I only got one neopixel to work so far because of some arduino issues / my original neopixel was broken.</p>
<p>&nbsp;</p>
<p>Future work:</p>
<p>I want to create the full lighting system idea with neopixels. I also hope to integrate it into an interactive standing desk and make it bluetooth controlled. I also want to work on different light diffusion techniques to create a brighter light display.</p>
<p><a href="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/02/Assignment6.zip">Assignment6</a></p>
<p>&nbsp;</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=446</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Assignment 6: Cornflower Field</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=695</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=695#respond</comments>
				<pubDate>Tue, 27 Feb 2018 16:00:44 +0000</pubDate>
		<dc:creator><![CDATA[oet@andrew.cmu.edu]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=695</guid>
				<description><![CDATA[For this assignment, I wanted to create a sort of minefield using p5 that you could navigate (as a blue dot with a trail) using a gyroscope. I turned the minefield into a calming blue field of dots that don&#8217;t explode when you run over them, mostly because I was having enough difficulty creating the &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=695" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 6: Cornflower Field"</span></a>]]></description>
								<content:encoded><![CDATA[<p>For this assignment, I wanted to create a sort of minefield using p5 that you could navigate (as a blue dot with a trail) using a gyroscope. I turned the minefield into a calming blue field of dots that don&#8217;t explode when you run over them, mostly because I was having enough difficulty creating the player and chose to ignore adding too much detail to the scene.</p>
<p>My main issues with this assignment arose with my serial, naturally. I tried to make a complex connection, but after spending ages attempting to make it work, I decided that maybe I needed to try making a more basic interaction and work upwards from there. I was still hopeful that my serial control issues were just due to my own oversights. So instead of trying to create a mouse using a gyro, I chose to start with getting data from a photo sensor, which I had used before, and using those numbers to drive the distance that the dot travels every time the player hits the space bar. So essentially, the game would be to be able to manipulate light and shadow on the sensor accurately to ensure that the player doesn&#8217;t run into a friendly blue flower (or mine) in their travels from one side of the screen to the other. The player would also be using their arrow keys (up and down) to determine the direction of the player.</p>
<p>Obviously, my problem actually didn&#8217;t lie in the complexity of my code, and my use of the photo sensor didn&#8217;t work out. Instead, I made/collaged from different random walker codes I found to create a code that would move the player at random speed intervals in quick succession. The game would be to use the up/down/side keys to navigate the board vertically. This took me a very long time to successfully create, and the result is a little disappointing, but kind of weirdly fun to play with.</p>
<p>Be warned, the player moves very fast, even at its slowest.</p>
<p>Here&#8217;s the code:</p>
<p><a href="https://courses.ideate.cmu.edu/48-339/s2018/wp-content/uploads/2018/05/Cornflower_minefield.zip">Cornflower_minefield</a></p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=695</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Assignment 6: complex I/O</title>
		<link>https://courses.ideate.cmu.edu/48-339/s2018/?p=436</link>
				<comments>https://courses.ideate.cmu.edu/48-339/s2018/?p=436#respond</comments>
				<pubDate>Sat, 24 Feb 2018 16:12:36 +0000</pubDate>
		<dc:creator><![CDATA[jet Townsend]]></dc:creator>
				<category><![CDATA[Assignment 6]]></category>

		<guid isPermaLink="false">https://courses.ideate.cmu.edu/48-339/s2018/?p=436</guid>
				<description><![CDATA[Use an input or output that uses a complex serial protocol on the SDA/SLC pins, tied to a p5.js sketch.    Read a sensor and generate a useful or interesting interface in p5.js or use a p5.js interface to control a stepper or series of NeoPixel LEDs.  [Edit: The goal here was to use SDA/SCL, if &#8230; <a href="https://courses.ideate.cmu.edu/48-339/s2018/?p=436" class="more-link">Continue reading<span class="screen-reader-text"> "Assignment 6: complex I/O"</span></a>]]></description>
								<content:encoded><![CDATA[<p>Use an input or output that uses a complex serial protocol on the SDA/SLC pins, tied to a p5.js sketch.    Read a sensor and generate a useful or interesting interface in p5.js or use a p5.js interface to control a stepper or series of NeoPixel LEDs.  [Edit: The goal here was to use SDA/SCL, if you didn&#8217;t, please use it in a future project.]</p>
]]></content:encoded>
							<wfw:commentRss>https://courses.ideate.cmu.edu/48-339/s2018/?feed=rss2&#038;p=436</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
