November 15

Nov 14, 2021 10:53PM

Bluetooth Issues.

Last week I had issues connecting my board to bluetooth due to a security error related to cross-origin iframe. I met with Professor Scott about this and found out that the issue could have been a result of chrome security updates and that the issue can be bypassed by running the code locally on my computer.

I cleaned up my p5 code and moved it over to visual studio and debugged a few things (missing lines of code, matching values). Then I did the same for my arduino code. (removed serial port stuff and replaced with BLE stuff). Eventually I was able to connect my Nano to my browser.

Howwever, I noticed that the behavior of the value mapping was way different than when I had it connected via serial port. This can be seen in the video below. Where the red dot just disappears instead of goinf up and down.

I then attributed this but to an error in data types. This is where I am having trouble at the moment. Since ble doesnt pass on string data types, and float values dont hold negatives, I may have to convert each character to a byte and read the values character by character. Once I figure this out, it should be easy to pass all 9 values (accel, gyro, magnetometer * x, y, z). Once this is done, I will proceed with refining motion related issues, and then sound issues.

Motion

Professor Scott also told me about the Madgwick library which helps parse the accelerometer, gyroscope, and magnetometer data. I’ve started looking into this a little to prepare for the coming week.

Sound

I gathered a bunch of web-sound resources. I am likely to stick with tone.js but it was nice to see what was out there and how people have been using different web audio libraries to create browser-based music. Generative fm is one of the more out there mind blowing ones that comes from computer generated sound.