#Arduino-snake
jquery : Used it to manipulate dom .Jquery.
server.js : Run this file in your node server on the same PC connected to which Arduino is connected.
snake.html : The file to be run on the client PC . Has the Snake game made entirely on HTML5 Canvas , Js. *Please edit the ip of PC in this file at 2 places mentioned in comments . { I made this repo amidst sleep }
snake.css : The style component of game . Not so required , but the semantics say so.
package.json : Helping file to install required node dependencies . Hint : "sudo npm install"
snake_sketch : This folder has the sketchfile to be uploaded in the Arduino device . A very simple need-not explain script .
- Two switches on a bread board .
- Gave input from the switches to 5 , 10 Digital pins to toggle Anticlockwise and clockwise respectively.
- The snake game starts only when socket is connected .
- The two buttons on Arduino allow us to send signals to the serialport opened by node app that listens for input
- As node gets input , it broadcasts the switch number to all clients .
- Clientside js interprets the direction and rotates the snake .