Automatic Toilet Flusher


Closed Thread
Results 1 to 40 of 99

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    COOL!
    What was the problem before?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Thanks, the reason it wasn't working was because pin 3 was not going to positive so for some reason the led kept being on but once I supplied the 5 volts + to pin 3
    it worked.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thanks, Good info.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Question pin 3 or pin 1

    Quote Originally Posted by Techbuilder View Post
    Thanks, the reason it wasn't working was because pin 3 was not going to positive so for some reason the led kept being on but once I supplied the 5 volts + to pin 3 it worked.
    Hi Techbuilder,
    Do you mean pin 3, or pin one (1) to plus (+)?
    <IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2351&stc=1&d=120266867 7">
    -Adam-
    Attached Images Attached Images  
    Ohm it's not just a good idea... it's the LAW !

  5. #5
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    Yeah actually your right

    it was pin 1 that I supplied the + to because pin 3 goes to ground

    Sorry my mistake

  6. #6
    Join Date
    Jul 2007
    Posts
    67


    Did you find this post helpful? Yes | No

    Default

    IRLED1 var PORTB.0
    Servo var PORTB.1

    TRISB=%00000001

    Loop:
    If IRLED1 =1 then
    Pulsout 0,130
    pause 10
    pulsout 0,150
    else
    pulsout 0,150
    endif
    Goto Loop

    End
    This is the code I made do you think this might work?

    Basically I want it to read the input and if the proximity sensor is activated then have it move the servo all the way to the right or left.

    To find the center of the servo
    I knew that dead center was 1.5ms and since I am using a 4mhz crystal the time interval of PULSOUT is in units of 10 us.

    So I used this equation to find my pulse
    1.5ms = 1500us
    and then 1500/10= 150

    and clockwise is 1.3ms so I did the same equation for that

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Can not comment about the servo, I do not know which one you are using.

    In your code

    Change
    Pulsout 0,130

    to

    Pulsout Servo,130

    Use either the full pin name ( PORTB.0 ) or the var assigned to it. Works much better I think.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Automatic 240V / 110V selector
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 13th October 2008, 00:33
  2. LCD automatic management?
    By ruijc in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th September 2008, 11:24
  3. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  4. Automatic turn off
    By AMay in forum Schematics
    Replies: 22
    Last Post: - 6th February 2006, 12: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