Go Down

Topic: Propeller Clock with Arduino Nano (Read 3297 times) previous topic - next topic

sergen03

May 24, 2012, 01:06 pm Last Edit: May 24, 2012, 01:44 pm by sergen03 Reason: 1
Hi everyone,
I'm working on 8 leds propeller clock with arduino Nano. I wrote a code but it's not completed. Please help for rest of the code.

Code that I wrote :

unsigned int digits [][8] = {
{ 0xC1,0xBE,0xBE,0xBE,0xC1} ,// "0"
 {0xFF,0xDE,0x80,0xFE,0xFF},// "1"
{0xDE,0xBC,0xBA,0xB6,0xCE}, // "2"
{0xBD,0xBE,0xAE,0x96,0xB9}, // "3"
{0xF3,0xEB,0xDB,0x80,0xFB}, // "4"
{0x8D,0xAE,0xAE,0xAE,0xB1}, // "5"
{0xE1,0xD6,0xB6,0xB6,0xF9}, // "6"
{0xBF,0xB8,0xB7,0xAF,0x9F}, // "7"
{0xC9,0xB6,0xB6,0xB6,0xC9}, // "8"
{0xCF,0xB6,0xB6,0xB5,0xC3},// "9"
{0xFF,0xC9,0xC9,0xFF,0xFF}, // ":"
};
int numberSpace;
int dotTime = 100;

void setup()
{
 pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
 pinMode(4, OUTPUT);
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
 pinMode(7, OUTPUT);
 pinMode(8, OUTPUT);
 pinMode(9, OUTPUT);
}
int k=0;
void loop()
{
 for(int i = 0; i<8 ; i++)
 {
   digits[k];
   delay(dotTime);
 }
 k++;
 if(k==8){
   k=0;
 }
}

PaulS

Quote
I'm working on 8 leds propeller clock with arduino uno.

Define what a propeller clock is, please.

Quote
I wrote a code but it's not completed. Please help for rest of the code.

When is our homework due?

Quote
Code that I wrote :

The code AS YOU POSTED IT won't even compile. Not that posting properly (using the # icon) would have helped.

Code: [Select]
digits[k][i];
is about as useful as
Code: [Select]
0xBE;
which, of course, accomplishes nothing.

sergen03

#2
May 24, 2012, 01:32 pm Last Edit: May 24, 2012, 01:45 pm by sergen03 Reason: 1
Firstly, I am not professional sorry for my faults,
I'm working on digital propeller clock with 8 leds like this : http://www.youtube.com/watch?NR=1&v=kE57dnBTsV0&feature=endscreen;
Homework due to 05.28.2012;
Code is compiling. ------->> http://imageshack.us/photo/my-images/193/adszsym.png/
I took digits from here -------->> http://www.bobblick.com/techref/projects/propclock/mclock8.asm

RandallR

It might help to structure your code so you can see better what you are doing.  For example if you convert you hex to binary you could betters see your digits.
Code: [Select]

unsigned int digits [][8] = {/*0*/  { 0B11000001,      //  ..#####.
                                      0B10111110,      //  .#.....#
                                      0B10111110,      //  .#.....#
                                      0B10111110,      //  .#.....#
                                      0B11000001},     //  ..#####.
                             /*1*/  { 0B11111111,      //  ........
                                      0B11011110,      //  ..#....#
                                      0B10000000,      //  .#######
                                      0B11111110,      //  .......#
                                      0B11111111},     //  ........
                             /*2*/  { 0B11011110,      //  ..#....#
                                      0B10111100,      //  .#....##
                                      0B10111010,      //  .#...#.#
                                      0B10110110,      //  .#..#..#
                                      0B11001110},     //  ..##...#
                             /*3*/  { 0B10111101,      //  .#....#.
                                      0B10111110,      //  .#.....#
                                      0B10101110,      //  .#.#...#
                                      0B10010110,      //  .##.#..#
                                      0B10111001},     //  .#...##.
                             /*4*/  { 0B11110011,      //  ....##..
                                      0B11101011,      //  ...#.#..
                                      0B11011011,      //  ..#..#..
                                      0B10000000,      //  .#######
                                      0B11111011},     //  .....#..
                             /*5*/  { 0B10001101,      //  .###..#.
                                      0B10101110,      //  .#.#...#
                                      0B10101110,      //  .#.#...#
                                      0B10101110,      //  .#.#...#
                                      0B10110001},     //  .#..###.
                             /*6*/  { 0B11100001,      //  ...####.
                                      0B11010110,      //  ..#.#..#
                                      0B10110110,      //  .#..#..#
                                      0B10110110,      //  .#..#..#
                                      0B11111001},     //  .....##.
                             /*7*/  { 0B10111111,      //  .#......
                                      0B10111000,      //  .#...###
                                      0B10110111,      //  .#..#...
                                      0B10101111,      //  .#.#....
                                      0B10011111},     //  .##.....
                             /*8*/  { 0B11001001,      //  ..##.##.
                                      0B10110110,      //  .#..#..#
                                      0B10110110,      //  .#..#..#
                                      0B10110110,      //  .#..#..#
                                      0B11001001},     //  ..##.##.
                             /*9*/  { 0B11001111,      //  ..##....
                                      0B10110110,      //  .#..#..#
                                      0B10110110,      //  .#..#..#
                                      0B10110101,      //  .#..#.#.
                                      0B11000011},     //  ..####..
                             /*:*/  { 0B11111111,      //  ........
                                      0B11001001,      //  ..##.##.
                                      0B11001001,      //  ..##.##.
                                      0B11111111,      //  ........
                                      0B11111111},     //  ........
};

It is more lines of code but it is more readable.

You set up all your output pins but you are not outputting anything.

You also don't have a sync source.  A Propeller Clock will only work if you have a place in your rotation where you can start your display.
Some people use and IR sensor, some use a Hall Effect sensor, but you need something.

James C4S

These kind of projects are also known as POV: persistence of vision.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

sergen03




You set up all your output pins but you are not outputting anything.

You also don't have a sync source.  A Propeller Clock will only work if you have a place in your rotation where you can start your display.
Some people use and IR sensor, some use a Hall Effect sensor, but you need something.


We tried to use Hall Effect sensor (HAL505) but it has low sensitivity, it did not work properly.
Thanks for your response, it was useful for us.

Go Up