Shop OBEX P1 Docs P2 Docs Learn Events
help prgramming an elevator — Parallax Forums

help prgramming an elevator

zephyr692zephyr692 Posts: 2
edited 2007-12-07 04:25 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-07 02:29
    There are no sample programs for this kind of thing. I suggest you start with the various tutorials that Parallax has available for download. The introduction one is "What's a Microcontroller?". Others include "Basic Analog and Digital", "Industrial Control", and maybe "Process Control".

    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.
  • BeanBean Posts: 8,129
    edited 2007-12-07 02:33
    I assume this is not an elevator for people ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • zephyr692zephyr692 Posts: 2
    edited 2007-12-07 02:53
    no it isn't
    ·
  • metron9metron9 Posts: 1,100
    edited 2007-12-07 04:25
    Can I assume this is an assignment from a computer class? I remember the same question over a year ago was posted here.

    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!
Sign In or Register to comment.