truck gate


Closed Thread
Results 1 to 13 of 13

Thread: truck gate

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Posts
    2

    Question truck gate

    Hi i am a newbee

    can someone help me

    The problem.

    I have a big gate that i want to open and close true a radio controller thats only have one button. It`s one switch at the top and one at the bottom of the gate to tell when the gate is open or closed.. If you puch the button and the gate is down the gate must go up and, and down when the gate is at the topp.
    But when the port is going down and you puch the button the port stops, and if you puch it again it`s going up and reverse.

    if someone can make a simple program to me i wil be so happy.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,129


    Did you find this post helpful? Yes | No

    Default

    If I get it right, you have two non-compatible systems to interface through a PIC based circuit without any experience and without any feedback from the gate door...

    I think you have to start with the classic LED flasher example and then write something more complicated and IF is not working then come here to show what you have done. Then we can offer all the help to you.

    But the case here is not so easy as you think. You can't be sure when the door is open or close. So you can not give the appropriate command. There are solutions ready made for this kind of gates with the security it needs. I do this for living and for sure is not for novice!

    Ioannis

  3. #3
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    The cheek of some people :-)

    First post and bang straight in

    How much do you want to pay for code ? :-))

  4. #4
    Join Date
    Oct 2007
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    The program i made is like this, but now it goes down when the gate have stoped.

    trisb = %00001111
    portb = 0

    main:
    pause 500
    if portb.0 = 1 and portb.7 = 1 then 'portb.7 switch top'
    goto down 'portb.0 is the sender-
    endif
    if portb.0 = 1 and portb.6 = 1 then 'portb.6 switch buttom'
    goto up
    endif
    if portb.0 = 1 and portb.7 = 0 and portb.6 = 0 then
    goto down
    endif
    goto main

    down:
    pause 500
    portc.0 = 1 'c0 sends the port down,
    if portb.0 = 1 then
    goto stopp
    if portb.6 = 1 then
    portc.0 = 0
    goto main
    endif

    up:
    pause 500
    portc.1 = 1 'c1 sends the port up'
    if portb.0 = 1 then
    goto stopp
    endif
    if portb.7 = 1 then
    portc.1 = 0
    goto main
    endif

    stopp:
    portc.0 = 0
    portc.1 = 0
    if portb.0 = 1 then
    goto main
    endif
    end

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,129


    Did you find this post helpful? Yes | No

    Default

    Yes it will go down or up instead of where you want to. I explained why. You can't expect synchonization that way. You will never know where the gate is every time.

    Ioannis
    Last edited by Ioannis; - 11th October 2007 at 21:38.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I can think of three options.

    This is all happening between the top and bottom switch.

    1 - Remember direction of travel:
    If the gate is going down, write a value to a variable or EEPROM so the after you stop the gate , the next time the button is pushed, read the stored value and have that value equal down. Use the same method but a different value for up.

    2 - Toggle reverse/start/stop:
    If the gate is in motion - push button to stop - remember the direction of travel. Push button again and the gate reverses.. If not going the way you want it to push the button two more times.

    3 - GET ANOTHER BUTTON!
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,129


    Did you find this post helpful? Yes | No

    Default

    What about power failure?

    Ioannis

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Geeze... a problem summarised in one short paragraph. The last one that landed on my desk was 27 pages deep...

    So, you have a 1 Button Remote, to control a 2 Button application.

    Press the Button momentarilly and the Gate goes UP. This means that for safety in an emergency it goes UP if you hit it.

    If the Gate is already in motion (in any direction) when it receives a Button press, it STOPS.

    Press the Button and HOLD it for at least 3 Seconds before releasing and the Gate goes DOWN.

    If it's a Prison Gate, just reverse the priority...

    30 seconds, done and dusted... and the next problem...

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    What about power failure?

    Ioannis
    Thats easy...The gate don't work!
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Sine wave power inverter
    By sougata in forum mel PIC BASIC Pro
    Replies: 244
    Last Post: - 23rd February 2017, 05:16
  2. A logic gate chip with 1 ea XOR and 2 ea AND gates?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 5th August 2009, 05:29
  3. MOSFET driver
    By showtime in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st October 2007, 22:07
  4. Combinaton Gate access
    By Archangel in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 22nd February 2007, 01:20
  5. HPWM problem .. pls help!
    By Samuel in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 1st February 2006, 15:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts