Skip to content

Commit 7ed3868

Browse files
committed
Arduino UNO memeory shrinking
1 parent f204ca5 commit 7ed3868

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Therefore this is an attempt to:
1616
- ***NEW*** 📢: *Medium-power* BLDC driver (<30Amps): [Arduino <span class="simple">Simple<b>FOC</b>PowerShield</span> ](https://github.com/simplefoc/Arduino-SimpleFOC-PowerShield).
1717
- See also [@byDagor](https://github.com/byDagor)'s *fully-integrated* ESP32 based board: [Dagor Brushless Controller](https://github.com/byDagor/Dagor-Brushless-Controller)
1818

19-
##### <b> Release notes be:</b> <i>Simple<b>FOC</b>library</i> v2.1.2
19+
##### <b> Release notes:</b> <i>Simple<b>FOC</b>library</i> v2.1.2
2020
> - Sensor floating point error bugfux #83
2121
2222
## Arduino *SimpleFOClibrary* v2.1

examples/hardware_specific_examples/SimpleFOC-PowerShield/version_v02/single_full_control_example/single_full_control_example.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ InlineCurrentSense current_sense = InlineCurrentSense(0.001, 50.0, A0, A1);
1717
// commander communication instance
1818
Commander command = Commander(Serial);
1919
void doMotor(char* cmd){ command.motor(&motor, cmd); }
20+
void doTarget(char* cmd){ command.scalar(&motor.target, cmd); }
2021

2122
void setup() {
2223

@@ -75,9 +76,10 @@ void setup() {
7576

7677
// subscribe motor to the commander
7778
command.add('M', doMotor, "motor");
79+
command.add('T', doTarget, "target");
7880

7981
// Run user commands to configure and the motor (find the full command list in docs.simplefoc.com)
80-
Serial.println("Motor commands sketch | Initial motion control > torque/current : target 0Amps.");
82+
Serial.println("Motor ready.");
8183

8284
_delay(1000);
8385
}

examples/hardware_specific_examples/SimpleFOCShield/version_v2/double_full_control_example/double_full_control_example.ino

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ InlineCurrentSense current_sense2 = InlineCurrentSense(0.01, 50.0, A1, A3);
3232

3333
// commander communication instance
3434
Commander command = Commander(Serial);
35-
void doMotor1(char* cmd){ command.motor(&motor1, cmd); }
36-
void doMotor2(char* cmd){ command.motor(&motor2, cmd); }
35+
// void doMotor1(char* cmd){ command.motor(&motor1, cmd); }
36+
// void doMotor2(char* cmd){ command.motor(&motor2, cmd); }
37+
void doTarget1(char* cmd){ command.scalar(&motor1.target, cmd); }
38+
void doTarget2(char* cmd){ command.scalar(&motor2.target, cmd); }
3739

3840
void setup() {
3941

@@ -111,8 +113,10 @@ void setup() {
111113
motor2.target = 2;
112114

113115
// subscribe motor to the commander
114-
command.add('A', doMotor1, "motor 1");
115-
command.add('B', doMotor2, "motor 2");
116+
// command.add('A', doMotor1, "motor 1");
117+
// command.add('B', doMotor2, "motor 2");
118+
command.add('A', doTarget1, "target motor 1");
119+
command.add('B', doTarget2, "target motor 2");
116120

117121
// Run user commands to configure and the motor (find the full command list in docs.simplefoc.com)
118122
Serial.println("Double motor sketch ready.");

examples/hardware_specific_examples/SimpleFOCShield/version_v2/single_full_control_example/single_full_control_example.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ InlineCurrentSense current_sense = InlineCurrentSense(0.01, 50.0, A0, A2);
1717

1818
// commander communication instance
1919
Commander command = Commander(Serial);
20-
void doMotor(char* cmd){ command.motor(&motor, cmd); }
20+
void doTarget(char* cmd){ command.scalar(&motor.target, cmd); }
21+
// void doMotor(char* cmd){ command.motor(&motor, cmd); }
2122

2223
void setup() {
2324

@@ -73,8 +74,9 @@ void setup() {
7374
motor.target = 2;
7475

7576
// subscribe motor to the commander
76-
command.add('M', doMotor, "motor");
77-
77+
command.add('T', doTarget, "target");
78+
// command.add('M', doMotor, "motor");
79+
7880
// Run user commands to configure and the motor (find the full command list in docs.simplefoc.com)
7981
Serial.println("Motor commands sketch | Initial motion control > torque/voltage : target 2V.");
8082

0 commit comments

Comments
 (0)