|
CLASS DOCUMENTS
REPORTS & ASSIGNMENTS
CLASS CONTENT
USING THIS SITE
registered authors login here You are: (logout) For more on PMWiki, see pmwiki.org |
Mjh 348Communicating with Processing through a PIC has been something i have loathed (and avoided) ever since first trying about a year ago. Today I still don't enjoy the process, I can say, with confidence, that it is something I am comfortable in doing... Why the turnaround? Simply, because it was something I had to do. While the assignment was not aking for much, it took several days (4) of banging my head against the wall for it to sink in. I basically took the code samples Tom provided, used a basic potentiometer as a sensor, and tried to get those to work properly. Once those codes worked, I started to add bells and whistles. After successfully implementing Tom's Processing Datalogger, I repurposed it to suit my whims. I wanted to depart from the green and black horizontal scrolling mountains I so closely associate with computer-ness. I ended up using circles that grow as sensor data increases (turning a pot, pushing on an FSR, bending a flex sensor, et cetera). I also mapped the color of the circle to reflect the changing sensor levels. For reference, I added markers every 50 steps. Right now, the color changes with the growing circles but i would like to change it to reflect something different (like magnitude of change in peak value or an additional sensor's reading). Following are the codes I used in this week's assignment (easier to read version): Sending All Sensor Data - PIC Code define OSC 4 SensorValue var word tx var portc.6 n9600 con 16468 TRISA = %11111111 Main: serout2 tx, n9600, [SensorValueB] low portb.0 Sending only Peak Values - PIC code Datalogger - Ellipse - Processing Code import processing.serial.*; ![]() ![]() Image 2 |