? on code


Results 1 to 11 of 11

Thread: ? on code

Threaded View

  1. #8
    Join Date
    Mar 2004
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    I'm setting B.1 low with a 5k resistor to gnd. and high with wire inserted into breadboard.I'm sure the wire is far worse than a button. I had just tried this:


    i Var Byte

    Loop:

    If PortB.1=1 Then

    High PortB.0

    for i=1 to 60
    Pause 1000
    next

    Low PortB.0

    EndIf


    DoNothing:
    If PortB.1=1 Then
    Goto DoNothing
    EndiF

    low 0 }I added this
    pause 500 } "

    if portb.0=0 then} "
    Goto Loop

    endif

    I'm sure you're right about the "bounce" as this fixed the problem.
    I'll try your code instead though.
    The high to B.1 will actually come from an optoisolator in the final stage. I've got alot more code to figure out on this project and if you or anyone can recomend a book that would help,please do.
    Thanks,
    Sam

    NavMicroSystems,I just sent you a PM.
    Last edited by Sam; - 7th March 2004 at 22:12.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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