Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Motortesting:

It has been tested to transmit a signal to a single motor (2015-05-20)
The test was succesfull for the following code:

MotorTest
//***********MOTOR CONFIG**************
//Motor PWM Levels
#define MOTOR_ZERO_LEVEL  125
#define MOTOR_ARM_START  140
#define MOTOR_MAX_LEVEL  254
//Motor Pins
#define MOTOR3  9
  int i= 0;
//**********CODE**********************
void setup() {
  // put your setup code here, to run once:
 Serial.begin(9600); 
  motorInit();
  delay(2000);
  motorArm();
  delay(2000);
}
void loop() {
  for(i= 0; (MOTOR_ZERO_LEVEL + i) < MOTOR_MAX_LEVEL; i=i+30) {
    analogWrite(MOTOR3,MOTOR_ZERO_LEVEL + i);
    Serial.println(MOTOR_ZERO_LEVEL + i);
    delay(1000);
  }
  for(i=0; (MOTOR_MAX_LEVEL - i) > MOTOR_ZERO_LEVEL; i=i-30) {
     analogWrite(MOTOR3,MOTOR_MAX_LEVEL - i);
     Serial.println(MOTOR_MAX_LEVEL - i);
    delay(1000); 
  }
}
//initialize the Motors
void motorInit(){
  pinMode(MOTOR3,OUTPUT);
}
void motorArm(){
  analogWrite(MOTOR3,MOTOR_ZERO_LEVEL);
}

 

 

 

  • No labels