NOOB in need of help


Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Jan 2009
    Posts
    14

    Default NOOB in need of help

    Hi -
    I am new to PICBasic and to the forums. I have PICBasic Pro if that matters, I am unsure. I am having few problems.

    I want to control few servos based on if this button is pressed etc... To start figure I would use either buttons or switches (same thing) and light up LED's based on if pressed then do kind of thing. Simple enough but for some reason my LED's blink and not just stay lit and trying to figure out why. Attached is an image of my electronics setup and here is my code. Also I am using a PIC16F84A chip and all the examples in books show an external crystal. If anyone knows how to do this without using the external crystal, that would be nice too.

    Please tell me what I am doing wrong and how to do this better. Many thanks!


    main

    if portb.0 = 1 then gosub pressed0
    if portb.0 = 0 then gosub npressed0
    if portb.1 = 1 then gosub pressed1
    if portb.1 = 0 then gosub npressed1
    if portb.2 = 1 then gosub pressed2
    if portb.2 = 0 then gosub npressed2
    if portb.3 = 1 then gosub pressed3
    if portb.3 = 0 then gosub npressed3
    goto main

    pressed0:
    high portb.4
    pause 200
    return

    npressed0:
    low portb.4
    pause 200
    return

    pressed1:
    high portb.5
    pause 200
    return

    npressed1:
    low portb.5
    pause 200
    return

    pressed2:
    high portb.6
    pause 200
    return

    npressed2:
    low portb.6
    pause 200
    return

    pressed3:
    high portb.7
    pause 200
    return

    npressed3:
    low portb.7
    pause 200
    return
    Attached Images Attached Images  

Similar Threads

  1. LCD_AnyPin.pbp
    By Darrel Taylor in forum PBP Extensions
    Replies: 112
    Last Post: - 23rd September 2024, 18:06
  2. Replies: 2
    Last Post: - 7th March 2008, 02:16
  3. Help a noob out?
    By yasiryassin in forum mel PIC BASIC
    Replies: 2
    Last Post: - 15th January 2008, 06:37
  4. Crystals & Caps - Super noob question??
    By kevj in forum General
    Replies: 4
    Last Post: - 24th September 2007, 17:11
  5. Uber noob needs clarity!
    By bill12780 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd July 2007, 21:40

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