Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mattdr
supermileage_2018
Commits
b734d568
Commit
b734d568
authored
Jan 22, 2019
by
thcl
Browse files
Testing after we broke a mosfet
parent
a064c813
Changes
2
Hide whitespace changes
Inline
Side-by-side
source_code/Teensy32/src/encoder.cpp
View file @
b734d568
...
...
@@ -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
=
-
105
1
;
int
hard_coded_offset
=
32
1
;
// 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
,
100000
0
);
delay
(
5000
);
//sit tight for a bit
}
...
...
source_code/Teensy32/src/motor_ctrl.cpp
View file @
b734d568
...
...
@@ -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
*
2
0
;
potval
=
potval
*
4
0
;
return
(
int
)
potval
;
//read from pot
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment