//============================================================ // Arduino POV Display // // Author: Carlos Asmat // Last Modified: August 17, 2007 // // Description: this is a quick code for a POV display // implemented using the Arduino. It used 6 LEDs // connected to the pins. // See http://carlitoscontraptions.blogspot.com // for more details. // //============================================================ /************************************************************* Slightly modified (1st Jan 2009) by Ben Harvey to work with my flash pov array maker, from http://gomako.co.uk All I did was reverse the order of the pins to work with my array order in flash. All the hard work was done by Carlos Asmat at http://carlitoscontraptions.blogspot.com What to change to match your sketch: col_length - the number of LEDs in your array frame_len - the number of columns in each frame frame_num - the number of frames in total The rest of it you can muck about with as much as you want. *************************************************************/ int pins[] = {1,2,3,4,5,6}; // an array of pin numbers int col_len = 6; // column length // customizable parameters int timer1 = 4; // time between columns int timer2 = 20; // time between frames int timer3 = 0; // time between drawings int frame_len = 5; // frame length int frame_num = 7; // number of frames // data corresponding to the image to be displayed int data[] = {0 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,0 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,0 ,1 ,0 ,1 ,0 ,1 ,0 ,0 ,1 ,1 ,0 ,0 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,1 ,1 ,0 ,0 ,0 ,0 ,1 ,1 ,0 ,0 ,0 ,0 ,1 ,0 ,1 ,1 ,1 ,1 ,0 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 ,0 ,0 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,1 ,0 ,0 ,0 ,0 ,1 ,1 ,0 ,0 ,0 ,0 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,1 ,1 ,0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