Commit b734d568 authored by thcl's avatar thcl
Browse files

Testing after we broke a mosfet

parent a064c813
......@@ -20,7 +20,7 @@ int Zoffset = 0;
// This is the difference in encoder tics from the Z index to
// the electrical encoder zero (which is found by powering the
// AB block and waiting for the motor to settle)
int hard_coded_offset = -1051;
int hard_coded_offset = 321;
// how long in microsec (us) to delay between phases while calibrating
// the wheel
......@@ -66,7 +66,7 @@ void encoder_setup(void)
//xPosn.zeroFTM(); //This zeros the counter
//setup the speed timer to run ever 1 sec
speed_timer.begin(print_speed_ISR, 100000);
speed_timer.begin(print_speed_ISR, 1000000);
delay(5000); //sit tight for a bit
}
......
......@@ -30,7 +30,7 @@ void motor_butt_control_precalculated(void);
void motor_setup(void) {
// put your setup code here, to run once:
float freq = 8000.00;//8000;
float freq = 8000.00; //8000;
pinMode(L1, OUTPUT);
pinMode(L2, OUTPUT);
......@@ -57,13 +57,13 @@ void turn_all_off() {
digitalWrite(L3, LOW);
}
int one_to_255(int x)
int one_to_255(int x) // this funct. pulls in pot values and scales them
{
if (x == 1)
{
float potval = analogRead(A0);
potval = potval/1024;
potval = potval * 20;
potval = potval * 40;
return (int)potval; //read from pot
}
else{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment