Need help with Pot command


Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Oct 2008
    Posts
    65

    Default Need help with Pot command

    Hi everyone, I want to learn how to use POT command so I tried some codes and try also to simulate it on protues.
    Code:
    Include "modedefs.bas"	' Include serial modes
    TRISB =%00000001
    Portb =%00000000
    ' Allocate variables
    x Var Byte
    
       CMCON = 7     ' Set PORTA to digital
       Pause 100     ' Wait for LCD to start
    
    mainloop:
       Pot PORTB.0, 127, x
       Serout PortB.1,T9600, [$Fe,1]
       serout PortB.1,T9600,[" Pot ",#x] ' Send value to LCD
       Pause 100                 ' for delays
       Goto mainloop             ' Do it again
    
       End
    I tried to play around with the variable potentiometer to see if its displays varies, but it jumps from 2-8-15-47-255. How can I make it increment by 1 to have a smooth display to 255? I tried to change the pot resistance between 5-10K but no luck.
    Attached Images Attached Images  
    Last edited by mbox; - 21st August 2010 at 11:16. Reason: trouble with image

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