Progress – F15 60-223: Intro to Physical Computing https://courses.ideate.cmu.edu/60-223/f2015 Carnegie Mellon University, IDEATE Thu, 17 Dec 2015 20:19:25 +0000 en-US hourly 1 https://wordpress.org/?v=4.5.31 Visualizing Arduino Data https://courses.ideate.cmu.edu/60-223/f2015/visualizing-arduino-data/ https://courses.ideate.cmu.edu/60-223/f2015/visualizing-arduino-data/#respond Thu, 12 Nov 2015 16:42:45 +0000 http://courses.ideate.cmu.edu/physcomp/f15/60-223/?p=10689 Arduino has come out with a serial plotter, but it leaves a lot to be desired. In order to visualize Arduino data, I have had better luck with processing. There is a sample program on the arduino site: https://www.arduino.cc/en/Tutorial/Graph. The processing code is a comment in the arduino sketch. You can download processing at: https://processing.org/download/

Also, the processing code didn’t work for me at first. I added the code I used at the end of this post, but it would be good to look at the code in the arduino sketch since it has a good way to draw a line graph.


// Example by Tom Igoe

import processing.serial.*;

Serial myPort; // The serial port
PFont myFont; // The display font
String inString; // Input string from serial port
int lf = 10; // ASCII linefeed
int xPos = 0;
void setup() {
size(600,600);
// You'll need to make this font with the Create Font Tool
//myFont = loadFont("ArialMS-18.vlw");
//textFont(myFont, 18);
// List all the available serial ports:
printArray(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Keyspan adaptor, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil(lf);
}

void draw() {
background(0);
// get the ASCII string:
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);

/* replace this code with code to draw your data
String[] vals = inString.split(",");
// convert to an int and map to the screen height:
float y = float(vals[0]);
float x = float(vals[1]);
y *= -1;
x = map(x, -100, 100, 0, height);
y = map(y, -100, 100, 0, width);

// draw the line:
stroke(127,34,255);

arc(x-5, y-5, 10, 10, 0, 2*PI);
*/
}
}

void serialEvent(Serial p) {
inString = p.readStringUntil(lf);
}

]]>
https://courses.ideate.cmu.edu/60-223/f2015/visualizing-arduino-data/feed/ 0
embedding videos, yes. https://courses.ideate.cmu.edu/60-223/f2015/embedding-videos-on-our-blog/ https://courses.ideate.cmu.edu/60-223/f2015/embedding-videos-on-our-blog/#respond Tue, 03 Feb 2015 17:46:29 +0000 http://courses.ideate.cmu.edu/physcomp/f15/60-223/?p=6930 As of a few minutes ago, we have a new plugin that makes embedding videos much easier.

Just paste the URL to the video and it will auto-convert to the embed!

]]>
https://courses.ideate.cmu.edu/60-223/f2015/embedding-videos-on-our-blog/feed/ 0