DStike Bad Watch
A cool watch for Arduin beginners
The watch could be recognized as a key board for computers. That is why a lot of people use it as a Bad USB.
It is an atmega32u4 development watch with a distance sensor, laser, buzzer, RGB LED & RTC inside. It is pre-flashed with a demo program that can display time, inside temperature (RTC3231's temperature), & distance.
Push the switch upwards & the watch will detect distance between you & your target. If distance is less than 1m, buzzer will sound "B~" and RGB will turn RED at the same time. The distance sensor can only detect 0-1.2m range.
Push the switch downwards & the laser will be enabled. Push down again and it will turn off the laser.
You can change the BadUSB code to do what you want with a computer. Just for fun.
What makes it special?
Bootloader is Arduin Leonardo
Buzzer(Digital Pin 12)
RGB LED(Digital Pin 6)
Laser(Digital Pin 13)
1.3 OLED SH1106(IIC)
SDA(Digital Pin 3)
SCL(Digital Pin 2)
Button Up(Digital Pin 10)
Button Down(Digital Pin 8)
Button Select(Digital Pin 9)
VL53L0 Distance Sensor(IIC)
Extremely Accurate DS3231(IIC)
40-70mA power cost(work time depends on your code)
Indicate charging LED (25%，50%，75%，100%)
Power Switch (Click to turn on, double click to turn off, long click to open highlight LED)
How to program it
* Open IDE and select "Arduin Leonardo" in the board option.
Tips - I put all the design files and code on my github. When you try the example code you had better to download libraries into your Arduin IDE first
1.Bad USB -
Bad USB code part can only be put at the setup() field. If you put it in the loop() you may have a problem where the computer cannot recognize the watch. You have to re-flash bootloader to fix this problem.
2.Power Keep -
I use IP5306 to power this watch. When IP5306 detect current less than 45mA it will turn off power automatically. So I use a PowerKeep code to simulate every 10 seconds click power button. That will keep ip5306 output power all the time. If you do not add this code, this board may run about 30 seconds and then turn off power automatically.
When you find time does not show correctly, you can flash demo code again. Time will synchronize the same time with your computer.