Sunday, 25 April 2010

IDAT209 - Projection - Implementation


Sensor that we will be using.

So after creating two versions of the actual thing were projecting we were now ready to begin thinking about implementation.

The main problems with the implementation were going to be using the motion sensor on the Arduino board, and getting hold of a decent enough projector for our project.

The code side of it was a bit tricky, so we decided to use a webcam for initial testing. This is the code for the webcam.

onClipEvent (load) {
lee=true}
onClipEvent (enterFrame) {
c = Camera.get();
c.onActivity = motion(mode);
_root.girl.attachVideo(c);
_y=-c.activityLevel*2+200
if (c.activityLevel>=70 && c.activityLevel<=75 && lee==true){ this.gotoAndStop(2); } This code was supplied to us by Lee. Once we had refined the webcam code, we decided to start working with the Arduino board. After speaking to Lee we found that we could have either used Flash/AS3 or Processing. We decided to work mainly with Flash/AS3 as we all had Windows PC’s. However we did also find some code for using processing. Once we got the coding out the way the only problem we had was getting hold of the actually projector itself. In the end I managed to convince one of my friends to borrow one. Below is a diagram of what the projection will be like.