Right. I failed.
So getting four variables to work is not what I consider an easy task.
The variables are php, sql, processing and microcode studio.
Granted, Tom is very kind in supplying code for all four elements, but actually getting things to work is a different story!
Initially, I wanted to use a piezo sensor attached to a bungee cord (it's for a project from a different class) but that was giving me very erratic numbers. To limit yet another variable, I decided to default to my favorite sensor - the rotary potentiometer!
Turns out the piezo wasn't what was causing me troubles...
So I turned to find help. Ms. Leah Wechsler was very kind in helping me fix up my php code. Check out my code here.
I had never worked with php (nor sql, nor cgi-bins, nor databases, nor anything this assignment covers) so that in itself was a tremendous feat for me.
After several hours of troubleshooting, writing to the sql database worked!
Then I played with Processing. Thinking back to the original datalogging assignment, I was not as intimidated approaching serial communication between a PIC and desktop. Call that false confidence. My initial code did nothing, so I scaled back to the original datalogging Processing code. I took out the SERIN command on the PIC and voila! Processing accepted the sensor reading.
Back in Processing, I slowly rebuilt the code (recopying Tom's code) line by line.
Time was quickly passing and my confidence slightly rising, so I put the SERIN command back, crossed my fingers, and pressed 'play'.
I got one reading into my sql database.
Why only one? I still do not know...
Something is happening on the Processing side that will only allow one reading to dump into the database. I debugged more times than NYC has cockroaches... And here I am detailing my failed experience to dynamically take data from a sensor and have it put into a database...
In the end, I suppose I'm happy to have experienced the torture and pain that is getting sensor data into a web-based database. I am sad it didn't work out the way it was supposed to, but I suppose that's just the way it has to be. I'm not a coder, in any sense, so I suppose I'm destined to fail at coding...