November 29

Nov 29, 2021 06:39PM

With bluetooth working…

The next step was to settle the sound issue and modify code to make it similar to the demo of the circuit playground.

The issue I had involved the data being sent. It was causing lag and inaccuracy. With Professor Alex’s help, the issue was mitigated by adding a small delay in the arduino code. Additionally I realized that I forgot to add my calibration code when I used the Madgwick library, so I also updated that.

There is also an issue of tone js hanging on one note playing multiple sounds, so to ensure that no two sounds are playing at once, I ended up deciding that the best course of action was to take the change in each of the axes and play only the appropriate sound for the axis with the greatest change. Then more code in between to make sure that the sound stops when the device stops.

Over the next week, I will have to fix the issue relating to lag. At the momen I am passing in 9 pieces of data (since I have been using these for tests). At the moment. My current project only uses 3 pieces of the data (the arduino uses the accel and gyro so the p5 sketch wont need it). I will modify the code and see if it helps with the lag.

Extra Extra.

Once I clean up my code, I have the option of changing up the visual and making it more fun to look at. I will see what I end up with.

As for the sound, I think it is good the way it is, but I want to provide the option of changing keys or modes because as seen in the examples above, the effect of the sound is very different when using notes from c major vs notes used in canon.

If I have enough time, I think it would be cool to explore ways the sound created can be saved. (maybe a 8 note loop).

Final Issues

I still have the issue of powering the device. I am currently settling for using a powerbank but am struggling to think of a way to display/package the arduino x powerbank given that it is a bit clunky.

I tried thinking of different ways to use motion such as just hanging the arduino like such: