Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Exhibition / Re: :) my first not-so-good persistence of vision on: December 28, 2010, 12:57:36 am
thanks! glad people are still coming across this.
you are welcome to use it anyway you like.

smiley i made this first project long time ago, learned a lot more since then.

I can probably make this better if i ever re-do a simliar POV.
delayMicroseconds() is definitely needed, hm.
i also tried using TimerOne library and interrupts to keep counts in another POV. that worked out okay too.

and i also tried using just time counting using the example Blink Without Delay() and i personally don't like that too much.

have fun with arduino!
2  Forum 2005-2010 (read only) / Exhibition / Re: :) my first not-so-good persistence of vision on: June 29, 2010, 07:33:48 am
smiley-grin sure. i didn't realize people would like the codes so much; lol, i didn't think anything of it.

let me post some comment on the codes, hopefully it will be helpful to whoever want to try something similar  smiley


Quote
// 7 LED POV

// letter width. since i have 7 LED, then each letter would look like a 7 x 5 matrix
#define WIDTH 5

//library, each letter stored in hex number instead of bit, five hex numbers make a letter; hence each hex number represent a column of a letter.

const byte font [][WIDTH] =
{
 {0x7e, 0x09, 0x09, 0x09, 0x7e}, //A
 {0x7f, 0x49, 0x49, 0x49, 0x36}, //B
 {0x3e, 0x41, 0x41, 0x41, 0x22}, //C
 {0x7f, 0x41, 0x41, 0x22, 0x1c}, //D
 {0x7f, 0x49, 0x49, 0x49, 0x49}, //E
 {0x7f, 0x09, 0x09, 0x09, 0x09}, //F
 {0x7e, 0x41, 0x49, 0x49, 0x38}, //G
 {0x7f, 0x08, 0x08, 0x08, 0x7f}, //H
 {0x00, 0x41, 0x7f, 0x41, 0x00}, //I
 {0x30, 0x40, 0x41, 0x7f, 0x01}, //J
 {0x7f, 0x08, 0x14, 0x22, 0x41}, //K
 {0x7f, 0x40, 0x40, 0x40, 0x40}, //L
 {0x7f, 0x02, 0x04, 0x02, 0x7f}, //M
 {0x7f, 0x02, 0x0c, 0x10, 0x7f}, //N
 {0x3e, 0x41, 0x41, 0x41, 0x3e}, //O
 {0x1e, 0x21, 0x21, 0x21, 0x5e}, //Q
 {0x7f, 0x09, 0x19, 0x29, 0x46}, //R
 {0x26, 0x49, 0x49, 0x49, 0x32}, //S
 {0x01, 0x01, 0x7f, 0x01, 0x01}, //T
 {0x3f, 0x40, 0x40, 0x40, 0x3f}, //U
 {0x07, 0x38, 0x40, 0x38, 0x07}, //V
 {0x3f, 0x40, 0x3f, 0x40, 0x3f}, //W
 {0x63, 0x14, 0x08, 0x14, 0x63}, //X
 {0x07, 0x08, 0x70, 0x08, 0x07}, //Y
 {0x61, 0x51, 0x49, 0x45, 0x43} //Z  
};


//set up pin 0 - 7 as OUTPUT
void setup()
{  
 for (int k=0;k<=7;k++)
    pinMode(k,OUTPUT);
}

//method of displaying the letters. displaying each column (one hex number) of the letter one by one through PORTD. then after a letter, it puts a space in between and move onto the next letter. until however long of the String you wish to display.
//each letter is first turned into ASCII integer, then minus 65. It would then be the row of the letter from the library above. (ex. A is 65 in ASCII, but row 0 in my library)
// furthermore, because of the way i made the hardware, it displays each letter starting from the back of the sentence, and each letter from the right most column.

void display (char POVstring[])
{
 for (int i=(strlen(POVstring)-1); i>=0; i--)
   {  for (int j=(WIDTH-1); j>=0; j--)
       { PORTD = font[(int)POVstring-65][j]; delay(1); }
       PORTD = B00000000; delay(1);
   }
}

// you simply feed a string to display it. this code only allows capital letters. however, if you add characters or lowercases in the library above, it would also be able to display it. (but then it would minus a different number instead of 65 above)

void loop()
{
if ( analogRead(5)==0 )
 { display("HELLO"); }
}
3  Forum 2005-2010 (read only) / Exhibition / Re: :) my first not-so-good persistence of vision on: June 24, 2010, 07:44:50 am
o, i didn't know there such a thing as Microsecond()
that changes a lot! awesome.

1.) yeah, analog 5 is a hall effect sensor. i didn't know digitalRead is faster.. i suppose i could try that  smiley-grin
2.)i guess laggy as in... it doesn't refresh very fast. hardly "persistence" of vision.
3.) i have no idea what the rotational rate is. i just strapped on a motor and let it spin. lol, i guess raron's guess on the speed is probably right on.

so i could get a more stable display (which was my problem) if i use Microsecond and increase the motor speed? okay, sounds like a easy fix!

wow, thanks for all the positivity / input, guys!
 ;D

4  Forum 2005-2010 (read only) / Exhibition / Re: :) my first not-so-good persistence of vision on: June 23, 2010, 05:45:38 am
lol, not the kind of input i was looking for, but.. thanks!
5  Forum 2005-2010 (read only) / Exhibition / :) my first not-so-good persistence of vision on: June 23, 2010, 12:24:06 am
My first Arduino project: a classic persistence of vision display.

Definitely disappointed; it seems a lot worse than other ones i have seen people make. smiley-sad
but i think i will try again with another design. a clock perhaps.

any comment on my code? Is there another way to code POV?
it seems so.. laggy?
i read something about using interrupt, but i didn't exactly know how that works. I only have very basic C++/ arduino programming experience.

any advice would be appreciated!  smiley-grin

Quote
// 7 LED POV

// letter width
#define WIDTH 5

//library
const byte font [][WIDTH] =
{
  {0x7e, 0x09, 0x09, 0x09, 0x7e}, //A
  {0x7f, 0x49, 0x49, 0x49, 0x36}, //B
  {0x3e, 0x41, 0x41, 0x41, 0x22}, //C
  {0x7f, 0x41, 0x41, 0x22, 0x1c}, //D
  {0x7f, 0x49, 0x49, 0x49, 0x49}, //E
  {0x7f, 0x09, 0x09, 0x09, 0x09}, //F
  {0x7e, 0x41, 0x49, 0x49, 0x38}, //G
  {0x7f, 0x08, 0x08, 0x08, 0x7f}, //H
  {0x00, 0x41, 0x7f, 0x41, 0x00}, //I
  {0x30, 0x40, 0x41, 0x7f, 0x01}, //J
  {0x7f, 0x08, 0x14, 0x22, 0x41}, //K
  {0x7f, 0x40, 0x40, 0x40, 0x40}, //L
  {0x7f, 0x02, 0x04, 0x02, 0x7f}, //M
  {0x7f, 0x02, 0x0c, 0x10, 0x7f}, //N
  {0x3e, 0x41, 0x41, 0x41, 0x3e}, //O
  {0x1e, 0x21, 0x21, 0x21, 0x5e}, //Q
  {0x7f, 0x09, 0x19, 0x29, 0x46}, //R
  {0x26, 0x49, 0x49, 0x49, 0x32}, //S
  {0x01, 0x01, 0x7f, 0x01, 0x01}, //T
  {0x3f, 0x40, 0x40, 0x40, 0x3f}, //U
  {0x07, 0x38, 0x40, 0x38, 0x07}, //V
  {0x3f, 0x40, 0x3f, 0x40, 0x3f}, //W
  {0x63, 0x14, 0x08, 0x14, 0x63}, //X
  {0x07, 0x08, 0x70, 0x08, 0x07}, //Y
  {0x61, 0x51, 0x49, 0x45, 0x43} //Z  
};
  
void setup()
{  
  for (int k=0;k<=7;k++)
     pinMode(k,OUTPUT);
}


void display (char POVstring[])
{
  for (int i=(strlen(POVstring)-1); i>=0; i--)
    {  for (int j=(WIDTH-1); j>=0; j--)
        { PORTD = font[(int)POVstring-65][j]; delay(1); }
        PORTD = B00000000; delay(1);
    }
}

void loop()
{
 if ( analogRead(5)==0 )
  { display("HELLO"); }
}


6  Forum 2005-2010 (read only) / Exhibition / Re: Hard drive clock - numeric || hand & dial || word on: July 19, 2010, 11:18:06 pm
the misalignment is due to the compartment (where the light are separated into compartments) isn't perfect made. so light leaks between and create unwanted light spots

haha, anyway, sorry guys, i got tired of this project, i have put it aside and making a RGB coffee table right now  smiley
7  Forum 2005-2010 (read only) / Exhibition / Re: Hard drive clock - numeric || hand & dial || word on: July 08, 2010, 06:02:34 pm
thank you  smiley

i did thought of the design myself, loosely based on a lot of the other ones you see out there.
Like this..
or
and http://letsmakerobots.com/node/2898 helped me A LOT when i was trying to power the motor

you can make one with way higher resolution if you drill smaller and more holes and have more set of lights behind the plate smiley
however the code probably will get a lot more tedious/ complicated.

it's like as loud as regular hard drive running during stand by smiley
mine is running at about... 1666 rpm.
usually desktop hard drive can max out 7200 rpm. i think

 ;D i will definitely share the codes once i tidy them up. right now it's really long and inefficient. still working on it
8  Forum 2005-2010 (read only) / Exhibition / Hard drive clock - numeric || hand & dial || word on: July 07, 2010, 04:44:53 pm

this is my second arduino project. another persistence of vision. i feel like it's much better than my other project, so i am quite excited.
However, it's still a work in progress and tons of little things to fix/ reprogram. i just feel like showing off a little bit first ;D

this is a hard drive clock. I've saw some cool ones out there, so i wanted to make one myself. However, the ones i saw was either numeric time display (with numbers cut out on a plate) or hand/dials (with a silt cut on the plate) Instead of choosing just one, i wanted to make one that's capable of displaying time/ message in any way i want to.

What i have done:

-- i have drilled 6 holes through the plate, each on a radius 60 degree apart. each a different distance from the center. or in other words, i have 6 points in polar coordinate [1,0o], [2,60o], [3,120o], [4,180o], [5,240o], [6,300o]
-- underneath the plate, i have divided it into 6 compartments of LEDs, each individually controlled.
-- there's a small magnet on the plate and a hallf effect sensor indexing the plate's rotation (you can even see them in the picture if you look hard enough)
-- with a little programming on our beloved arduino, we can have right compartment blinking at the right time to display 216 different "pixels"

problems i had:
-- never worked with a stepper motor before, i had a hard time getting the hard drive spinning at first. i had stripped down hard drive to four wires in the back, so it took me a lot time to figure out which 3 to pulse (and which one was the common cathode.)
-- after much frustration and fruitless tries, i realized 5 volt with 40ma per pin was the problem. (who knew motors need so much power?  smiley)
so i added some 2N2222 transistor to amplify the current.
-- after i FINALLY got the motor running (it was also really tricky finding the right increment to accelerate it from rest) my resistors / 2N2222 started smoking.  :o i looked at the datasheets again. i guess they weren't rated for 5v & 800ma (4 watts). opps. i bought some extra high power transistors to solve the problem. so it's 4ma from arduino amplify to 50ma from 2N2222 to ~1.2A from a power transistor. appearntly the setup is called a darlington pair
-- everything is running great. then suddenly everything stops. i keep thinking things are overheated, but apparently AAs batteries run out of charge rather fast. lol i now haev it pluged into an ac adapter

here's some more pictures, i shall post up the code or more pictures after i tidy things up and fix those leaking light dots.
next step: fixes those darn leaking light, or perhaps make it RGB?

9  Forum 2005-2010 (read only) / Exhibition / Re: Standalone + FTDI on: June 25, 2010, 04:50:40 am
this is awesome!  ;D
like the other person said, i love the SMD led!

i am just a curious noob, but why don't you need a crystal at pin 9 & 10? Or that huge capacitor looking thing is the crystal? O.o
10  Forum 2005-2010 (read only) / Exhibition / Re: arduino Tix Clock on: June 28, 2010, 02:47:59 am
 :o cool!

my aunt gave me one for christas years ago.
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: drive lots of LED, TLC5940 ? TLC 5947? on: July 11, 2010, 01:47:50 pm
and is there a difference between like NT and NTG4?
12  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: drive lots of LED, TLC5940 ? TLC 5947? on: July 11, 2010, 01:46:55 pm
well, i have some 595 lying around already.
but it just sounds like insanely tedious programming when it's RGB.

o, so you DON'T really need color correction for RGB? O.o
13  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: drive lots of LED, TLC5940 ? TLC 5947? on: July 10, 2010, 09:10:35 pm
whoa. marklar, thanks for listing it out, you're the man.

i actually didn't realize it could get so expensive.
hmm, i guess go the cheapest rout with just a dozen TLC + 100 non-diffused. $43, that's cool.

maybe if i just get the table / glass frosted enough or play with the distance, it would come out diffused enough.

 ;D okay, now i think i know what i need. time for online shopping.
thanks everybody!
14  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: drive lots of LED, TLC5940 ? TLC 5947? on: July 10, 2010, 05:40:11 pm
o, hm! thanks!
i think i came across those once!
they just seems too expensive to me, $2 an LED?

it would cost me well over 100 to make a 8 by 8 coffee table.
:/ great suggestion though, maybe if i can't figure out this 5940s thing, that can be an option.
15  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: drive lots of LED, TLC5940 ? TLC 5947? on: July 10, 2010, 04:34:51 pm
aw, i think they stopped making M5451, or else 30 output sounds awesome.
Pages: [1] 2