Shop OBEX P1 Docs P2 Docs Learn Events
I need Help — Parallax Forums

I need Help

coolkids2015coolkids2015 Posts: 6
edited 2016-12-19 23:24 in BASIC Stamp
So i started coding this project. What i want to confirm is will the program do what i think it will do. The whole point is to create a elevator, that can go to the floor you desire. In theory this should work, if i didnt mess up, but i want to make sure the program would work like its expected. So can anyone test the code, and maybe let me know thanks :D

Also i want to confirm this with servo motors. Lets say i say this
DoorOpenClose:
HIGH GreenLed
LOW GreenLed
PAUSE 1500
HIGH RedLed
LOW RedLed
PAUSE 500
RETURN

GearTurn:
PULSOUT 9, angle
RETURN

ReturnToSecondFloor:
PULSOUT 9, 750
Return


          'If pushbutton that is connected to pin 3 is pressed then do this..
        ELSEIF (IN3 = 1) THEN
        ' Angle = 750 therefor do angle - 500 which will be 250
        angle = angle - 500
         'Will go to sub GearTurn which will make the gear in motor turn to 0 degrees which is set to 250
        GOSUB GearTurn
        'Doors will open and close once arrived on that floor
        GOSUB DoorOpenClose
        'I dont know if this right but im guessing that the servo motor will return to 90 degrees which is set to 750
        GOSUB ReturnToSecondFloor

Comments

  • Welcome to to Forums!

    Please use the code tags [ code ] [ /code ] (without the spaces inside the brackets) to post code .This preservers indentations and such.

    At this point, what does it or not does it do?
  • coolkids2015coolkids2015 Posts: 6
    edited 2016-12-20 01:41
    Publison wrote: »
    Welcome to to Forums!

    Please use the code tags [ code ] [ /code ] (without the spaces inside the brackets) to post code .This preservers indentations and such.

    At this point, what does it or not does it do?
    Heres the full code ill be removing in under 24 hours due to reason but here
    So whats should happen is that it should act like a elevator. I use the second floor (which will be 90 degrees, as the starting point, every time the code is ran it should return to the second floor. I want to confirm that this code will work

    [/code]
  • The code as written will not compile without errors.

    Press F7 in the Basic Stamp IDE. You need to correct the errors first.
  • coolkids2015coolkids2015 Posts: 6
    edited 2016-12-20 01:59
    Publison wrote: »
    The code as written will not compile without errors.

    Press F7 in the Basic Stamp IDE. You need to correct the errors first.

    IDK which code i sent you, the older one or newer, but heres the one with no errors.

    [/code]

  • OK. What part of it does not work?

    It's very hard to troubleshoot a scenario like this without a schematic and a photo of your setup. Is this something you could provide?

  • coolkids2015coolkids2015 Posts: 6
    edited 2016-12-20 01:59
    Publison wrote: »
    OK. What part of it does not work?

    It's very hard to troubleshoot a scenario like this without a schematic and a photo of your setup. Is this something you could provide?

    Ill send schemetic, and i cant send a pic of setup, i just need someone to test it, and tell me if it works, or if the coding is wrong with the servo motor, because im sorta lost about servo motors.
    +I dont own a breadboard currently+





  • coolkids2015coolkids2015 Posts: 6
    edited 2016-12-20 02:00
    Heres the schem
  • What's to prevent you to hook up the components and try it?
  • Publison wrote: »
    What's to prevent you to hook up the components and try it?



    I mentioned above i dont have abreadboard here beside me, atm. Thats why i asked someone to look over the code, and spot any mistakes, or even test the code themself
  • And in all of the following on posts I did not see anything except for the messages.
Sign In or Register to comment.