Skip to content

IT Product Design @SDU.dk - Apprenticeship - Internet of Things

Notifications You must be signed in to change notification settings

itpd/pointnturn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Point'N'Turn

Find more about the project at http://itpd.github.io/pointnturn/

Javascript Interface

To initialize the Laser create a new PNTLaser object with 3 arguments:

  1. Address of websocket server, 'ws://achex.ca:4010' is very recommended
  2. ID of the controller. In future userful for security
  3. ID of the Point'N'Turn Laser device. (Right now hard-coded on line 14 in websocket.ino file)
  4. Optional ID of a log element

Initialize laser

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();

Initialize platform

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()

ToDo

  1. Make the DEVICEID in the code as a variable
  2. Interface for connecting to different wifis than 'SDU-GUEST' for ESP

Board setup with Arduino

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"

About

IT Product Design @SDU.dk - Apprenticeship - Internet of Things

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •