public static void Main() { MotorSettings motorSettings = GetMotorSettings(); Motor frontMotor = new PWMMotor(new PWM((Cpu.Pin)FEZ_Pin.PWM.Di6, 4000000), motorSettings); Motor rearMotor = new PWMMotor(new PWM((Cpu.Pin)FEZ_Pin.PWM.Di9, 4000000), motorSettings); Motor rightMotor = new PWMMotor(new PWM((Cpu.Pin)FEZ_Pin.PWM.Di10, 4000000), motorSettings); Motor leftMotor = new PWMMotor(new PWM((Cpu.Pin)FEZ_Pin.PWM.Di8, 4000000), motorSettings); MotorMixer mixer = new QuadMixer(frontMotor, rearMotor, leftMotor, rightMotor); //Sensors I2CBus twiBus = new I2CBus(); Gyro gyro = new ITG3200(twiBus); Thread.Sleep(2000); gyro.Zero(); Radio radio = new DotCopterRadio(twiBus, GetRadioSettings()); //Control Algoriths PID pid = new PIDWindup(GetPIDSettings()); ControllerLoopSettings loopSettings = GetLoopSettings(); new Controller(mixer, pid, gyro, radio, loopSettings); }
public static void Main() { MotorSettings motorSettings = GetMotorSettings(); Motor frontMotor = new PWMMotor(new PWM(Pins.GPIO_PIN_D10, 2 * 1000), motorSettings); Motor rearMotor = new PWMMotor(new PWM(Pins.GPIO_PIN_D5, 2 * 1000), motorSettings); Motor rightMotor = new PWMMotor(new PWM(Pins.GPIO_PIN_D9, 2 * 1000), motorSettings); Motor leftMotor = new PWMMotor(new PWM(Pins.GPIO_PIN_D6, 2 * 1000), motorSettings); MotorMixer mixer = new QuadMixer(frontMotor, rearMotor, leftMotor, rightMotor); //Sensors I2CBus twiBus = new I2CBus(); Gyro gyro = new ITG3200(twiBus); gyro.Zero(); Radio radio = new DotCopterRadio(twiBus, GetRadioSettings()); //Control Algoriths PID pid = new PIDWindup(GetPIDSettings()); ControllerLoopSettings loopSettings = GetLoopSettings(); OutputPort led = new OutputPort(Pins.ONBOARD_LED,true); new Controller(mixer, pid, gyro, radio, loopSettings); }