Things used in this project

Hardware components:
TinyLily
×1
LiPo battery
3.7V works (the Lily takes 2.7V – 5.5V in Arduino mode)
×1
Pair of glasses
×1
Enclosure materials
3D printer, chain-making tools, amber, etc.
×1
Software apps and online services:
D94d qxu
Autodesk Fusion 360

Code

bare-led.JPGC/C++
DreamGlass test code
/*
  DreamGlass code to test haptic motor with random timing.
  Modified from Arduino "Blink" example function.
  Turns on an LED on for one second, then off for one second, repeatedly.

  This code is in the public domain.
 */

  // Pin 13 has a haptic motor connected.
int haptic = 13;
long randel;                    // random delay interval

void setup() {
  pinMode(haptic, OUTPUT);      // initialize the digital pin as an output
}

void loop() {
  randel = random(500, 3000);   // generate random delay, 500-3000ms
  digitalWrite(haptic, HIGH);   // turn the motor on
  delay(500);                   // wait half a second
  digitalWrite(haptic, LOW);    // turn the motor off
  delay(randel);                // wait for a second
}

Credits

Photo on 7 5 17 at 5 06 pm 7 05huowsyxv
Alex Glow
65 projects • 558 followers
The Hackster team's resident Hardware Nerd. I like robots, music, EEG, wearables, and languages. FIRST Robotics kid.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login