Technical Progress

on

During sprint 3 I mainly focussed on getting the sensors and LEDs to work. Getting the sensors to work took a while but it works fine now. Like I said in previous post we are able to make 16 states with 4 LDRs.

First I needed to be able to read the values of the sensors and send them from arduino to Processing, because I want to have the main code done in Processing. The reason I want to have the main code in Processing mainly is that it’s easier to play audio with it. Which is important since our project relies for a big part on our audio.
I first used the Firmata software to send data from the arduino to processing, than I let processing handle the data. There I made 16 states, first with a lot of booleans, which was not only very inefficient but also very unlcear. Together with Douwe I made it more efficient by assigning a value of either 0 or 1,2,4 or 8 to the LDRs, and then just adding these values, which will form a value of 0 – 16.

After this was done I tried to program smooth stateswitches. Getting the previous audio to stop and not have any audio play at the same time was kind of a challenge, but in the end it worked out by shutting all audio off to be sure no other audio is playing and then turning the right one on. The first drafts were also very inefficitent and unclear, but after some puzzling I made it  more clear for me (and others) to understand and a bit more efficient.

Then I wanted to combine it with the LEDstrips. But the thing with the LEDstrips is that it doesn’t really work with Firmata, but it does have it’s own library and I wanted to use Douwes example code on blackboard for adressing the strips. So that meant I had to some how combine the LDR code with the LED code. I had to adjust a few things in Douwes code so I could make it send values of the LDRs too. And then it was just a matter of copy and pasting the right stuff.

Next step is coding the LED strips.

Leave a comment