0

POV for my bike
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

POV for my bike

by Omnimusha on Mon Mar 17, 2014 12:50 pm

Hello, I want to make a POV(Persistence of Vision) for my bike, is there any sample code for Arduino?
Omnimusha
 
Posts: 6
Joined: Mon Mar 17, 2014 3:00 am

Re: POV for my bike

by franklin97355 on Mon Mar 17, 2014 12:57 pm


franklin97355
 
Posts: 22152
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: POV for my bike

by adafruit_support_bill on Mon Mar 17, 2014 1:11 pm


adafruit_support_bill
 
Posts: 81913
Joined: Sat Feb 07, 2009 10:11 am

Re: POV for my bike

by Omnimusha on Mon Mar 17, 2014 1:23 pm

can move the code of spokePov to arduino?,
someone could do? sharing code Please
Omnimusha
 
Posts: 6
Joined: Mon Mar 17, 2014 3:00 am

Re: POV for my bike

by adafruit_support_bill on Mon Mar 17, 2014 1:53 pm

The processor on the SpokePOV is not the same as the Arduino. The code could probably be ported to the Arduino, but will not run exactly as-is. You would also need to replicate the rest of the SpokePOV circuitry: http://www.ladyada.net/media/spokepov/spokepov.png

adafruit_support_bill
 
Posts: 81913
Joined: Sat Feb 07, 2009 10:11 am

Re: POV for my bike

by Omnimusha on Mon Mar 17, 2014 2:29 pm

I'm having trouble calculating the time to paint the wheel.
is always open, or turned off.

me you can lend a hand?

Code: Select all | TOGGLE FULL SIZE
void setup () {
                   ...
....
..
       attachInterrupt (0, rpm, FALLING);
}


 void rpm(){
                 detachInterrupt(0);//Disable interrupt when calculating
                 
                    new_time=micros();

                    Aux  =  (( new_time - timeold)-  250000)/250 ; //244841=time it takes the paint arduino,--
                    if(Aux>0 && Aux<700 ){                                     // // 250=ray amount
                    Refresh=Aux ; }
                                       
                                           }
                    timeold =  new_time;
                    interruptHit=true;

                    attachInterrupt(0, rpm, FALLING); //enable interrupt
          }
       
       
       
        void loop(){

     if( interruptHit ==true){
       detachInterrupt(0);//Disable interrupt when calculating
            for(uint8_t curPos=0; curPos<160;curPos++ ){

                      for(uint8_t i=0;i<34;i+=1){  //number of pixels

                           PixelColor(i,  ,  R,G,B  ) ;
                    }
   
         ShowsWS2803();
             refreshEnd=micros();
             while((micros() - refreshEnd)< Refresh   ) {;}

         }
                           interruptHit =false;
               attachInterrupt(0, rpm, FALLING); //enable interrupt

else{
         
                      for(uint8_t i=0;i<nPixel;i++){
         
                                          PixelColor(i, 0,0,0) ;
                                             
                     
                      }
                     ShowsWS2803();
         
               }

}// end loop

Omnimusha
 
Posts: 6
Joined: Mon Mar 17, 2014 3:00 am

Re: POV for my bike

by Omnimusha on Mon Mar 17, 2014 11:25 pm

??? :?:
Omnimusha
 
Posts: 6
Joined: Mon Mar 17, 2014 3:00 am

Please be positive and constructive with your questions and comments.


cron