| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //#define SCAN_MODE // If set, scan & output channel values, rather than driving the robot.
- /////////////////////////////////////////////////////////////////////////
- // Configuration
- //////////////////////////////////////////////////
- #define MAX_POWER_PERCENT 90 // The maximum percentage on time, used to decrease average voltage to the motor.
- #define OUTPUT_RANGE 255 // The maximum value for PWM output
- ///////////////////////
- #define SCAN_DELAY 100 // Delay between updates in ms
- #define AVG_PERIODS 10 // Number of periods to average the speed over (reduces random variances)
- /////////////////////////////////////////////////////////////////////////
- // Channel pins
- /////////////////////////////////////////////////////////////////////////
- #define LOW_CHANNEL 1
- #define NUM_CHANNELS 6
- // Channel pins. Using numbers 1-6 for clarity, so using a bad value in index 0.
- const byte channels[7] = {255, 8,9,10,11,12,13};
- /////////////////////////////////////////////////////////////////////////
- // Channel values
- /////////////////////////////////////////////////////////////////////////
- // Right horizontal (steering)
- #define STEER_CHANNEL 1
- #define STEER_LEFT 1300
- #define STEER_RIGHT 1690
- #define STEER_NONE 1500
- #define STEER_DEAD_ZONE 30 // 10% of the range is dead zone
- // Right vertical (throttle)
- #define THROT_CHANNEL 2
- #define THROT_MAX 1940
- #define THROT_MIN 1160
- #define THROT_NONE 1510// Halfway range
- #define THROT_DEAD_ZONE 30 // approx 10% of the range is dead
- #define THROT_OFF 0 // Anything below this means the throttle switch (upper right) is off
- #define CH_4_MIN 0
- #define CH_4_MAX 0
- // Right knob
- #define LIGHT_CHANNEL 5
- #define LIGHT_MIN 990
- #define LIGHT_MAX 1990
- // Left knob
- #define SPEED_CHANNEL 6
- #define SPEED_MIN 1000
- #define SPEED_MAX 2000
- /////////////////////////////////////////////////////////////////////////
- // Output pins
- /////////////////////////////////////////////////////////////////////////
- #define LEFT_MOTOR_PIN 5
- #define LEFT_MOTOR_DIRECT_PIN 4
- #define RIGHT_MOTOR_PIN 6
- #define RIGHT_MOTOR_DIRECT_PIN 7
|