The Dot Watch is driven by an ArduinoNG with Atmega8. Dot Watch uses a 8x8 LED matrix to displace the current time. Four columns of LED matrix are used for displaying time in a 24-hour format.
- Columns 1 & 2 are used for hours.
- Column 1 represents 5 hour increments
- Column 2 uses 1 hour increments
- Columns 5 & 6 are used for the minutes.
- Column 5 shows minutes in 10-minute increments
- Column 6 flashes the minutes in 2-minute increments
1. Connect the LED matrix, Arduino NG and the resistors.
* Pin Assignments are as follows:
*
* 8x8 LED ----------------> Atmega8
* 1 -----------R220--------> D16 A(2): (connect to 220 ohm resistor between LED and Arduino)
* 2 --------------------------> D15 (A1) :
* 3 --------------------------> D14 (A0):
* 4 -----------R220--------> D13:
* 5 --------------------------> D12:
* 6 -----------R220--------> D11 :
* 7 --------------------------> D10 :
* 8 --------------------------> D9 :
* 9 -----------R220--------> D7 :
* 10 ---------R220--------> D6 :
* 11 ------------------------> D5 :
* 12 ------------------------> D4 :
* 13 ---------R220--------> D3 :
* 14 ------------------------> D2 :
* 15 ---------R220--------> D1 :
* 16 ---------R220--------> D0 :
2. Connect the USB cable to the Arduino NG and the computer.
3. Download the following sketch into the Arduino NG and wait for a few seconds. Dot Watch begins to work.
/* Dot Watch Code **
* Main Components:
* Atmega8
* 8x8 LED Matrix *
* Pin Assignments *
* 8x8 LED -> Atmega8
* 1 -> D16 A(2):
* 2 -> D15 (A1) :
* 3 -> D14 (A0):
* 4 -> D13:
* 5 -> D12:
* 6 -> D11 :
* 7 -> D10 :
* 8 -> D9 :
* 9 -> D7 :
* 10 -> D6 :
* 11 -> D5 :
* 12 -> D4 :
* 13 -> D3 :
* 14 -> D2 :
* 15 -> D1 :
* 16 -> D0 : *
* row # LED pin # ________________________________
*...... 0...... 5........I............................................................... I
* ......1.......1........I................................................................I
* ......2.....12........I......LED...................................................I
* ......3...... 2........I......MATRIX............................................I
* ......4.... 14........I......Ark SZ411288k..................................I
* ......5...... 3........I............................................................... I
* ......6...... 7........I............................................................... I
* ......7...... 8........I________________________________I
* .......LED pin #.......13...10...15....9....4.....16.....6.....1
* .......Col #............... 0.....1.....2....3....4.......5.....6.....7
*/
#define millisOverflow 34359738
unsigned long currentMillis = 0;
unsigned long previousMillis = 0;
int valm=0,valh=0;
int ticks = 0;
int seconds = 29;
int minutes = 58;
// The Dot Watch always starts operation @ 1258 hrs
int hours = 12;
// Set LED pins[x] for Arduino pins
int pin[17] = {-1, 16, 15, 14, 13, 12, 11, 10, 9, 7, 6, 5, 4, 3, 2, 1, 0};
// Set LED columns
int col[8] = {pin[13], pin[10], pin[15], pin[9], pin[4], pin[16], pin[6], pin[1]};
// Set LED rows
int row[8] = {pin[5], pin[11], pin[12], pin[2], pin[14], pin[3], pin[7], pin[8]};
void displayFlash() {
// Pulse four columns as seconds ticker
// Set columns 0, 3, 4, & 7 ON
digitalWrite(col[0], HIGH);
digitalWrite(col[3], HIGH);
digitalWrite(col[4], HIGH);
digitalWrite(col[7], HIGH);
//}
// Turn each row ON, then OFF
for (int i=0; i<8; 1 =" 5" 2 =" 1" 5 =" 10" 6 =" 2" displayhourscol1 =" 0;" displayhourscol2 =" 0;" displayminutescol1 =" 0;" displayminutescol2 =" 0;" displayhourscol1 =" displayHours" displayhourscol2 =" displayHours" displayminutescol1 =" displayMinutes" displayminutescol2 =" displayMinutes" displayminutescol2 =" 1;" displayminutescol2 =" 1;" displayminutescol2 =" 2;" displayminutescol2 =" 2;" displayminutescol2 =" 3;" displayminutescol2 =" 3;" displayminutescol2 =" 4;" displayminutescol2 =" 4;" displayminutescol2 =" 5;" counter="0;" dot="0;" now="" column="" 1="" for="" int="" dot="0;">
minutes++;
seconds = 0;
}
if (minutes >= 60) {
hours = hours + 1;
minutes = 0;
}
if (hours > 23) {
hours = 0;
}
// Flash the watch, then display the time
if (minutes == 0){
displayFlash();
}
if (minutes == 15){
displayFlash();
}
if (minutes == 30){
displayFlash();
}
if (minutes == 45){
displayFlash();
}
displayTime(hours, minutes);
previousMillis = currentMillis;
/*
valm = analogRead(5);
// add one minute when pressed
if(valm<800) minutes="minutes+2;" seconds="0;" valh =" analogRead(4);" seconds="0;" now="" column="" 1="" for="" int="" dot="0;">