I’m sure you agree that since this is work for academic credit, it needs to be YOUR work. In that case I suggest you avoid getting bogged down in the exact syntax of the programming language, since you don’t know how to write code and don’t seem to have time to learn. Instead, concentrate on describing the behaviour you want the code to have. One way to write this is by writing it in ‘pseudocode’. This is English text that follows the same basic structure as your target language but is only intended to be human-readable and is not intended to compile. The description of the sequence of actions you included in your original post is a credible starting point, but it would be better to restructure it to represent a sequence of events and actions, rather than describing something that happened. For example:
wait for switch to turn on
retract actuators 1 through 3
turn on electromagnets 1 and 2
retract actuator 3
You don’t seem to be using any inputs after the initial ‘switch on’ so, as described, the sequence would execute as fast as the actuators were capable of moving. If you intend this to be a simple timed sequence then that would be fine, given that commands like ‘retract actuator’ mean ‘send the sequence of output signals at the correct timing to move the actuator the required distance at the required speed’, with the intention that this command blocks (waits) until the movement is complete.
In practice, if you were really coding this, you might choose not to implement it in blocking code. Using a non-blocking approach would make it much easier to do several things simultaneously. However, it produces code which is more complex, and if you don’t have time to understand simple code then you don’t have time to understand more complex code.
This sounds like exactly what i am after. I realise now that learning and writing a code is more work than i have time for even with some pointers from you guys, so this pseudocode works for me.
The blocking code seems to be what i am after as these steps are linear and there are no simultaneous actions.
Thanks a lot for the help, i wouldn’t have even thought of doing it this way otherwise.
so i need to show that i have at least thought about how it might be coded,
but you haven’t.
but without sounding like an impatient ungrateful prat, I really don’t have the time to learn the code having never looked at it before,
but you do. You are asking us to help you cheat, to act in a deception.
Still it is only Sunday so you have the rest of the day to actually read something. Go on deserve that qualification.
It was never my intention to cheat or take credit for others work, i suppose i just needed something to start me off. either way this pseudocode works perfectly for me.
Thanks for everyones help