How i can use the tcs230 with pic


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Default How i can use the tcs230 with pic

    Hi
    I have problem with Tcs230 color sensor this sensor have frequency output how i can measure that?
    I'm use Pic16f877a & Pic Basic pro
    Thanks

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    This snipet has been copied from parallax and should work with pic. Use 4MHz resonator or change Define setting if different clock will be used.

    Code:
    Define OSC = 4
    
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 25  ' 9600 Baud @ 4MHz, 0,16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    
    
    EN con 1
    A0 con 2
    S0 con 3
    S1 con 4
    S2 con 5
    S3 con 6
    nLED con 7
    
    pRED con 12
    pGREEN con 6
    pBLUE con 5
    
    Pinx  var (pic pin connected to the output)
    RED var word
    GREEN var word
    BLUE var word
    
    Start: low A0
    high S0
    high S1
    low nLED
    high EN
    
    MainLp: gosub Color
    debug "R", dec3 RED
    debug " G", dec3 GREEN
    debug " B", dec3 BLUE
    debug cr
    goto MainLp
    
    Color: low S2
    low S3
    count pinx, pRED, RED
    high S3
    count pinx, pBLUE, BLUE
    high S2
    count pinx, pGREEN, GREEN
    return
    end
    Al.
    Last edited by aratti; - 26th February 2009 at 12:27.
    All progress began with an idea

  3. #3
    buketselen's Avatar
    buketselen Guest


    Did you find this post helpful? Yes | No

    Default Re: How i can use the tcs230 with pic

    : ı wonder the same question with you.ıf you succed your project could you send me it too.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 1

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