Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago.
Toward Zero_Power Zone, Help me find out The way of Reducing power consumption
Hello, I need your help, I'm newest on mbed.
I am developing project, using servo motor.
This project is including battery always, it will be never split from main frame.
So, I need to last a battery as long as I can, I measured ampere, It's originally 0.3mA,
after I declare 'Servo' class, It becomes 1.3mA. this additional power consumtion is not from servo motor.
Not sure, MCU consum the power. if you know anything about where the power is consumed, please tell me
I want to maintain the power 0.3mA.
What I thought the way was that free the class memory to make MCU doesn't know where servo is.
To Sum up
- I want to reduce power consumption
- After declare 'Servo' class the ampere 0.3mA -> 1.3mA
- I am trying to free class memory <- this is the problem
This is the code :
1.
void setServo(){ Servo servo; servo.write(90); return; } int main(){ while(1){ setServo(); } }
2.
int main(){ while(1){ Servo *servo = new Servo(); servo->write(90); delete servo; } }
this is only sample code how I tried.
this code was work well at first time,
but second declare it didn't work,
anybody knows how i can fix it?
or recommand the way of reduing power consumption by servo motor,
I just want to consum the power at when I need.
Thank you for reading my question.
1 Answer
9 years, 7 months ago.
One clear bug
Servo *servo = new Servo(); servo->write(90); // Should be -> not ., servo is a pointer. delete servo;
As for where the power is going we need more information. Which mbed? Which servo library?
It could be a timer that is getting started by the servo code and not getting shut down at the end but without knowing what the rest of the code is it's impossible to tell.
Thank andy,
I post again with additional information,
Please, check again,
https://developer.mbed.org/questions/55280/Reducing-power-consumption/
posted by 29 Jul 2015
Put
posted by Andy A 28 Jul 2015<<code>> and <</code>>
around your program, each on it's own line, and it will format the code correctly.Thank you for letting me know
posted by Taeyeop Kim 29 Jul 2015