how can i stop the pic from sending a PWM???


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by texas5 View Post
    wow.simple solution.haha.thanx a lot bruce.but are your coding mean i need to hold the push button to PWM on & release the button to PWM off...or push the button once to PWM on & push once again to PWM off????
    Read the code! Do you see anything in that code saving the state of the button to remember for the next time the loop checks the buttons state?
    The bit in the TRIS register follows the state of the push button...simple as that...just like it's written...

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Yep. Like Ski said, that's how it works.

    Here's another flavor.
    Code:
    Main:
      IF Push1=0 THEN
         GOSUB ChkState
      ENDIF
      GOTO Main    
      
    ChkState:
      WHILE Push1=0       ' wait for button release
      WEND
      TRISC.2=TRISC.2 ^ 1 ' toggle TRISC.2 on button release
      RETURN
    Endless simple possibilities.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  2. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  3. Replies: 9
    Last Post: - 8th October 2008, 11:15
  4. Sending data from 1 pic to other pic
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th September 2007, 00:51
  5. VB sending serial data to PIC
    By Tissy in forum Serial
    Replies: 7
    Last Post: - 8th March 2006, 18:31

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