Custom switch in Turnigy 9xr pro
Posted: Tue Oct 25, 2022 3:51 am
Hello all. I'm new to this forum and RC project.
Recently, I have a project customize a new RC based on Sky board. I want to change 2-pos switch (it is 3-pos in the firmware, such as SW_GEAR) to push button to switch between 2 states every time I push it. Now, when I push the button, the pwm rate (status of switch) changes but when I release, it turns back to the begin rate. I have read the firmware ersky9x, I found a function getMovedSwitch() where these switches are coded but I don't know how to modify the code to change from toggle switch to push switch. Can you guy show me how to solve it?
Thanks in advance!
Peter
Recently, I have a project customize a new RC based on Sky board. I want to change 2-pos switch (it is 3-pos in the firmware, such as SW_GEAR) to push button to switch between 2 states every time I push it. Now, when I push the button, the pwm rate (status of switch) changes but when I release, it turns back to the begin rate. I have read the firmware ersky9x, I found a function getMovedSwitch() where these switches are coded but I don't know how to modify the code to change from toggle switch to push switch. Can you guy show me how to solve it?
Thanks in advance!
Peter