Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Arduino Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Arduino Controller
Commits
59cf4a39
Verified
Commit
59cf4a39
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
perf: use uint16_t for wing_angles
parent
b106408a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controller/controller.ino
+4
-4
4 additions, 4 deletions
controller/controller.ino
with
4 additions
and
4 deletions
controller/controller.ino
+
4
−
4
View file @
59cf4a39
...
...
@@ -134,7 +134,7 @@ void setup() {
void
loop
()
{
int
potent
=
analogRead
(
POT_PIN
);
// Potentiometer value
u
nsigned
in
t
wing_angles
[
sizeof
(
gCSN_PINS
)];
// Wing angles (1L, 1R, 2L, 2R)
u
int16_
t
wing_angles
[
sizeof
(
gCSN_PINS
)];
// Wing angles (1L, 1R, 2L, 2R)
if
(
gMode
==
"SERIAL"
and
Serial
.
available
())
{
...
...
@@ -251,8 +251,8 @@ void StopMotor(int old_esc_val) {
//Read 12-bit rotary encoder (RobinL modified by linarism on forum.arduino.cc)
u
nsigned
in
t
ReadSensor
(
uint8_t
csn
)
{
u
nsigned
in
t
ret
=
0
;
u
int16_
t
ReadSensor
(
uint8_t
csn
)
{
u
int16_
t
ret
=
0
;
digitalWrite
(
csn
,
LOW
);
delayMicroseconds
(
1
);
//Waiting for Tclkfe
...
...
@@ -272,7 +272,7 @@ unsigned int ReadSensor(uint8_t csn) {
// Output data to use with serial-studio
void
SerialPrint
(
String
mode
,
int
potent
,
int
esc_val
,
u
nsigned
in
t
wing_angles
[],
float
psu_vol
[],
float
psu_cur
[])
{
void
SerialPrint
(
String
mode
,
int
potent
,
int
esc_val
,
u
int16_
t
wing_angles
[],
float
psu_vol
[],
float
psu_cur
[])
{
float
freq
=
esc_val
*
(
RpmToFreq
(
gMAX_RPM
)
/
180.0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment