LED 'Dot' Bargraph Issues - Newbie Code!


Results 1 to 12 of 12

Threaded View

  1. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: LED 'Dot' Bargraph Issues - Newbie Code!

    The averaging code is an INCLUDE file.

    Save it to a file called "Average_Hyst.pbp".
    Put the file in the same folder as your project, or the PBP folder.

    Then at the top of the code in post #4, add this line.
    Code:
    INCLUDE "Average_Hyst.pbp"
    The GOTO OverAverage line just jumps over the code, making sure execution doesn't "Fall Into" the subroutine without being called by a GOSUB.

    Then, change these lines to use the "Value" variable, instead of adval.
    Code:
    Main: 
        ADCIN 0, Value
        GOSUB Average
    
        LED = Value * LEDcount                  ; Determine which LED to light
        LED = DIV32 (1023 - Margin) - 1
    Edit: Whoops, sorry Henrik.
    Took me an hour to get his darn post to go through.
    The forums going up and down like an elevator.
    Ya beat me to it.
    Last edited by Darrel Taylor; - 14th February 2013 at 06:45.
    DT

Similar Threads

  1. Replies: 3
    Last Post: - 24th March 2015, 11:51
  2. Replies: 19
    Last Post: - 26th April 2012, 20:23
  3. Newbie needs example RC code
    By PickyBiker in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th March 2010, 02:10
  4. Microchip Code Issues
    By Destovi in forum General
    Replies: 4
    Last Post: - 20th March 2008, 13:32
  5. BaseBall pitching Code sample - NewBie
    By foxstar in forum Code Examples
    Replies: 12
    Last Post: - 8th May 2007, 19:29

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