help prgramming an elevator
zephyr692
Posts: 2
i would like if someone could tell me how to write a program for an elevator that has three floors and when a button is pressed the motor goes up and looks for a photo resistor and when the photo resistor has light the elevator stops and then goes down to the main level
i would really apreciate anyone who can help me by showing me a sample program because i am a novice at programming with pbasic
i would really apreciate anyone who can help me by showing me a sample program because i am a novice at programming with pbasic
Comments
I suggest you start with a list of what you want the elevator to do for each sensor. Make a table or a flowchart if you know what that is. You'll find that you can translate that kind of table relatively easily into a program. The tutorials I mentioned will show you how to wire and program switches and photoresistors, but you'll have to develop the rules to show what to do with the information.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
·
Can you give any input on how to write any code for this problem?
Perhaps you could just write some psudo code (code that doesn't execute but shows the logic)
Something like:
person presses button on floor 1
elevator goes to floor one
elevator opens door
elevator waits for 30 seconds
elevator closes door
...
etc...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!