Skip to content
Snippets Groups Projects
Verified Commit 59cf4a39 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

perf: use uint16_t for wing_angles

parent b106408a
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ void setup() {
void loop() {
int potent = analogRead(POT_PIN); // Potentiometer value
unsigned int wing_angles[sizeof(gCSN_PINS)]; // Wing angles (1L, 1R, 2L, 2R)
uint16_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)
unsigned int ReadSensor(uint8_t csn) {
unsigned int ret = 0;
uint16_t ReadSensor(uint8_t csn) {
uint16_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, unsigned int wing_angles[], float psu_vol[], float psu_cur[]) {
void SerialPrint(String mode, int potent, int esc_val, uint16_t wing_angles[], float psu_vol[], float psu_cur[]) {
float freq = esc_val * (RpmToFreq(gMAX_RPM) / 180.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment