Thursday, September 23, 2010

Mortimer Follows the Light (kind of)

 This week, our first challenge was to make Mortimer go towards the light (pun intended).
We did this by utilizing the light sensors. This lil' program let us graph what the light sensors recorded, so we could know what was 'normal' (like a reading of 450ish) and was what 'light' (less than 350, going down to 50). 

  

But this graph, by itself, wasn't too helpful. What would be better is to graph the differences between the two sensors. Since both of them are looking at the same light, taking the difference allows us to look at both of them at the same time. This program graphs it:

 

When looking at the graph of differences, we could then see if Mortimer was going too far right or left. (If the number went higher than the normal plateau, it meant the right sensor saw more light and Mortimer was going too far to the left, and vice versa.)
So know we can get Mortimer to start moving. At first, Yu Mei and I (especially me) got into a terrible rut of a too-complicated program that we couldn't get to work. (Very frustrating, but important to learn how to deal with.)
This was how we began--getting Mortimer to turn.


We made the movement a little clearer by also making the sensors face drastic ways (so we would know exactly when Mortimer was going too far one way). In the future, we might make the movement even clearer by adding a center sensor, so when it gets light Mortimer drives forward. (But that's for later.)

After two hours and lots of help from P-Berg, this was our program to follow the light.


And this is me getting Mortimer to (mostly) follow the light. Finally--lots of frustration and attempts went into this. 


 Later, and don't get discouraged like we did,
Lucia

No comments:

Post a Comment