A Raspberry Pi-powered light-based alarm clock for toddlers
$ git clone https://github.com/avonmoll/pi-clock/
$ cd pi-clock
$ sudo npm install
(sudo
may be necessary if installing directly on RPi)
Choose one of the following and then navigate to <hostname>.local:3000
:
pm2 (Recommended)
Install pm2:
$ sudo npm install -g pm2
Configure startup by running the following and then executing the last line of the output:
$ pm2 startup
Start app and save so pm2 will start the app on reboot:
$ sudo pm2 start server.js -o out.log --name pi-clock
$ pm2 save
The following command adds an entry to the root crontab to run the app on reboot.
$ sudo echo "@reboot root cd /home/<path-to>/pi-clock && sudo node server.js >> log 2>&1 &" >> /etc/crontab
$ sudo reboot
- Adafruit 7-segment 4-digit LED display with I2C backpack
- Recommend the white display to avoid clashing with indicator LEDs
- 10mm red LED (note: an additional 100 ohm resistor may be needed in series with one of the existing resistors since I used an LED rated for higher voltage)
- 10mm green LED
- resistors to protect LEDs
- male-female jumper wires
- male-male jumper wires
- breadboard or other perfboard
- Soldering iron (for the I2C backpack)
- Adafruit Learning Series (1-7)
- ApplePi-Baker: create SD cards for RPI from MacOS
- Raspbery Pi Pinout Guide
- 7-segment 4-digit Data Sheet
- i2c Backpack Wiring Instructions
Run grunt
for building and grunt serve
for preview.
Running grunt test
will run the unit tests with karma.
The web server was scaffolded with yo angular generator version 0.15.1.