Joined: 21 Feb 2011
|Posted: Mon Feb 21, 2011 9:41 pm Post subject: Coding Microcontroller Program for Spinning LED Display
Im in the middle of making a spinning LED display using a PIC16F88. Save a long winded explanation of the device the following is a video of something very simalar to mine:
Our setup is basically the same as that, but I am not an experienced PIC programmer. Would anyone be able to throw me in the right direction with regards to programming the microcontroller in a simalar project? I will have an optical sensor triggering every revolution, going into the uC, the spinning portion of the project has been created, the next step is basically programming the chip.
My thoughts -
The program has a constant within it which specifies the number of horizontal 'pixels' that occupy the circumference of the spinning arm. The program measures the time it takes for 1 revolution of the arm and divides that time by the pixel number. This provides the time it takes the arm to rotate from one specific pixel to the one neighbouring it. Using this time you can flash the LEDs on and off accordingly, to create an image.
Does this sound reasonable to anyone? Maybe there is another way I have not thought of that this can be done? Any help at all is massively appreciated.