Hi Im a nubie too, not good at this stuff. Ordered some HW and 08m chip.
Im helping an old boy at my model flying club. He likes free flight models - you start the motor and throw. A few seconds later after the climb the motor stops and you get the short floaty unpowered flight, the model comes down softly as a glider.
I did some scrappy code which does ok on the simulator.
I wanted to add safety features to it, but my mind cant make the extra step..
Currently I have,,,
If the push button on the fuselage is left alone, the code loops around a gosub Motor_off
If pilot wants to fly - pushes the momentary action button and gosub Motor_on occurs and then times out and returns.
(This is effectively what he has now on his model using r's and c's and a mosfet..)
The safety features I want to add to the existing code - if I could - are....
1)If the button for flight is knocked momentarilly by accident the motor should not run but if held down for 0.5seconds to 2seconds - run the motor
2)If the button has been pushed for between 0.5 and 2 seconds and the motor is running - the pilot can abort the motor run by pushing the button - either momentarily of for longer. The code should filp or return back to main and be ready to start off again after the panick abort.
Im struggling with the flowchart description of paralelling up code tasks or blocks. I tend to see a flowchart as a serial flow from start to end, I dont know how to put parallel flows into the design.
Any help appreciated,
Steve
Im helping an old boy at my model flying club. He likes free flight models - you start the motor and throw. A few seconds later after the climb the motor stops and you get the short floaty unpowered flight, the model comes down softly as a glider.
I did some scrappy code which does ok on the simulator.
I wanted to add safety features to it, but my mind cant make the extra step..
Currently I have,,,
If the push button on the fuselage is left alone, the code loops around a gosub Motor_off
If pilot wants to fly - pushes the momentary action button and gosub Motor_on occurs and then times out and returns.
(This is effectively what he has now on his model using r's and c's and a mosfet..)
The safety features I want to add to the existing code - if I could - are....
1)If the button for flight is knocked momentarilly by accident the motor should not run but if held down for 0.5seconds to 2seconds - run the motor
2)If the button has been pushed for between 0.5 and 2 seconds and the motor is running - the pilot can abort the motor run by pushing the button - either momentarily of for longer. The code should filp or return back to main and be ready to start off again after the panick abort.
Im struggling with the flowchart description of paralelling up code tasks or blocks. I tend to see a flowchart as a serial flow from start to end, I dont know how to put parallel flows into the design.
Any help appreciated,
Steve
Attachments
-
657 bytes Views: 11