Find more about the project at http://itpd.github.io/pointnturn/
To initialize the Laser create a new PNTLaser object with 3 arguments:
- Address of websocket server, 'ws://achex.ca:4010' is very recommended
- ID of the controller. In future userful for security
- ID of the Point'N'Turn Laser device. (Right now hard-coded on line 14 in websocket.ino file)
- Optional ID of a log element
var laser = new PNTLaser('ws://achex.ca:4010', 'PNTC', 'PNTL');
// moves the servos of laser pointer by X and Y degrees
// for example move(-3, 0) or move(3, -3)
laser.move(int x, int y);
// centers the laser
laser.center()
// moves the serovs of laser pointer to a random direction
laser.moveRandom()
// Turns laser ON
laser.laserOn()
// Turns laser OFF
laser.laserOff()
// Returns:
// false - no limit is hit
// '+' - limit hit on top
// '-' - limit hit on bottom
laser.limitX()
// Returns:
// false - no limit is hit
// '+' - limit hit on top
// '-' - limit hit on bottom
laser.limitX()
// Returns:
// true - connection is alright
// false - connection is lost or timed out (1000 ms)
laser.connected();
// returns last delay in ms
laser.getDelay();
// both Laser and Platform have switchLED() method which switches embedded LED on and off
platform.switchLED();
var platform = new PNTPlatform('ws://achex.ca:4010', 'PNTC', 'PNTP');
// moves the platform by Step of size (1-3) which takes 300ms
// Positive goes right, negative goes left
platform.rotate(Step);
// both Laser and Platform have switchLED() method which switches embedded LED on and off
platform.switchLED();
// Returns:
// true - connection is alright
// false - connection is lost or timed out (1000 ms)
platform.connected();
// returns delay in milliseconds
platform.getDelay()
- Make the DEVICEID in the code as a variable
- Interface for connecting to different wifis than 'SDU-GUEST' for ESP
https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/using-arduino-ide
- Flash Mode "QIO"
- Flash Frequency "40MHz"
- Upload Using "Serial"
- CPU Frequency "80 MHz"
- Flash Size "4M"
- Reset Method "nodemcu"