A/d 16f88


Closed Thread
Results 1 to 6 of 6

Thread: A/d 16f88

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Yes, you are right... in my haste I edited it incorrectly.

    I believe using a number is the worst way to do it, because it has no description behind it.

    A constant is just as tight as far as compiling goes, and a variable is the way to go if you need to change which port you are reading within the loop. Both of these have the advantage that you can change all of your constants up at their definitions on the top, and you can change them easily when you move things around, like to a different PIC or pin. Also, compare these two, which do the exact same thing:

    adcin 6
    vs.
    adcin BatteryVoltagePin

    Which is easier to understand? Obviously the second. And if you use three a/d ports, with the constants all defined in a row and then you need to move things, it's one edit at the top for each... no searching and replacing multiple lines.

  2. #2
    Join Date
    May 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default A/d 16f88

    Thanks to you both. Roger your code works fine. I'll read thru your comments and revisit the data sheet for a better grasp of it all.

Similar Threads

  1. 12f675 A/d Miseries
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 16th December 2008, 03:16
  2. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 15:39
  3. Need advice on A/D
    By james in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th August 2007, 20:30
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 19:57
  5. 18F2525 A/D, Comparator and Vref modules
    By fbraun in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st May 2005, 00:17

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