Пример #1
0
void ServoWave::update(){

  for(int i=0;i<numServos;i++){
    //  servoPositions[i] = 90; // starting position for all servos. could be passed as an argument 
    //how do i use wavelength

    long freq=1;//this is a constant that sin is changing
    //return a foloat based on numservos sin(period) is 
    //period = period + time;
    period = freq+period;
    freq++;
    //have freq have to do with servoPosition
//Serial.println(sin(period));
    amplitude = calcAmp(period);
  }
}
Пример #2
0
void ServoWave::update(){
//  for(int i=0;i<numServos;i++)
//  {
//   servos[i].write(servoPositions[i]); 
//  }
  for(int i=0;i<numServos;i++){
  //  servoPositions[i] = 90; // starting position for all servos. could be passed as an argument 


long freq=100;//this is a constant that sin is changing
//return a foloat based on numservos sin(period) is 
//long time = millis();
//period = period + time;
period = freq*period;
calcAmp(period);
  




//for(int i = numservos-1; i > 0; i--){
//    servoValues[i] = servoValues[i-1];
//  }

//for(int i=0;i<numServos;i++){//wtf
//    servoPositions[i] =amplitude;//add values for all servos depending on values in the constructor
 /*   
 numServos = 
  amplitude = 
  period = 
  wavelength = 
    */
    


}

/*
  
//  float dx = TWO_PI/period*
 // float wavelength = //number of servos for one full wavet
  float amplitude = new float[servo/xspacing]
  
 float  wavelengths_entire = wavelength*(TWO_PI)/numServos;
  float amplitude = numServos / wavelength_entire; //36 servos / 2
  float period = wavelengths_entire/time;
  float time = //time per
  
  float period = //how long until it repeats*/
//  int xspacing = wavelength 
//  
//loop through all of them, calculate the positions


//what greg showed me: a pointer to an int is really a pointer to the 0th position in an array. so int* myarray
//because it allots a value to something that is the first in a bunch, you dont know how many
//so it is used here cause i dont know how many servos and servopositions i will have

  //calc position of each
  //servo based on its prev position
  //add amp/period/wavelength

  //update the servo to that position
}
Пример #3
0
void EvtHypNonLepton::decay(EvtParticle* parent) {

    parent->initializePhaseSpace(getNDaug(),getDaugs());
    calcAmp(&_amp2,parent);

}