Sensor (Lesson 2)
Went through Lesson 2 and added the Beep. Dark was defined as less than half on the ADC scale, or as having the red light on. The beep is quite annoying.
I did get
SenseM.nc:126: warning: `SounderControl.start’ called asynchronously from `makeNoise’
while compiling the updated Sense program. I believe I got that because I made a function (that other functions could call, perhaps from an event) called makeNoise to function as the discriminator as to whether or not there was noise to be made. I don’t know how to make it not give me that warning.
I decided to have a little fun and made a counter (0 through 7) out of Blink and to add the annoying beep in there. I started out having it switch when the msb was on, but decided having four cycles of beep in a row was just a tad annoying. However, shortening the time between counts and putting the beep on the lsb made it sort of like a really annoying clock. I also made the “step” 500ms.
Another Idea for me to implement is to count the number of zeroes in the 7 most significant bits of the result from the light sensor and display the number. If there are more than 7 then display 7 and beep. This is under the guise that it would be easier to find the mote in that case…
Today sometime I want to set up Linux, let me know when you come around.
Comment by Shane — May 12, 2006 @ 8:58 am