This is the project that I will be presenting on August 30th for club fair. A testing video can be seen here.
This project is simply using ATmega32u4 and a bluetooth LE (BLE) moduleto receive information from iPhone's gyroscope for the quaternion. Then, using serial connection to feed Node.js to create a server that updates iPhone's position. A client side app will use the data to control a webGL cube.
This project goes around like this:
iPhone (quaternion data)
⬇️ Bluetooth Low Energy (BLE)
Adafruit 32u4 Feather
⬇️ Serial Comm. (baud rate: 115200)
Node.js server
⬇️ parsed nicely and upload to http://localhost:8000/ (127.0.0.1:8000)
intranet
⬇️ taken by client side, and taken by 3D model
client virtual phone moves.
First step is to start the server side. Run
ls /dev/tty.*
to determine which serial port you are using for Adafruit 32u3 Feather. Then change accordingly in serialToNode.js
.
Then install dependencies. Type
npm install serialport
If it fails, try this
sudo npm install serialport --unsafe-perm --build-from-source
If still doesn't work, reading this might help.
Next step, install ws (websocket).
npm install ws
this usually should work fine.
After all this, open a terminal and run
nodejs serialToNode.js
Or if your laptop runs MacOS or maybe older version of node.js, try
node serialToNode.js
Next, we are to open the client side. Open the file index.html
should do the job. It might not be able to support all the browsers, but FireFox should work.
I previously had a temeprary website I designed, but now I have a better one there.