NeoPixel (WS2812B) Demo


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,692


    Did you find this post helpful? Yes | No

    Default Re: NeoPixel (WS2812B) Demo

    Could i use all this code as a secondary code
    But the main program not to be affected by this code.
    ?

    using that code it takes about 1mS to send data to 24 ws2812's . so if your main program can tolerate 1mS gaps in processing every 50mS it would work ok

    if you used a more modern chip with a clc module then you could adapt my code
    found here :-
    http://www.picbasic.co.uk/forum/atta...5&d=1508279203
    that updates the leds as a background interrupt driven process with very very little overhead

    see this thread for that and other more efficient possibilities
    http://www.picbasic.co.uk/forum/showthread.php?t=23399

    But i really dont know how to import all this code or how to use this DT's interrupt method here.
    what have you tried ?
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: NeoPixel (WS2812B) Demo

    Many years ago, i did a simple RFID reader program.

    What it does is to read the RFID tag and if the ID number is stored in the PIC's ram, then it will make a port high.

    That is the whole program.

    I haven't tried anything yet to embed the above RGB code. What i would like to do with this code, is to work on the backround as an effect, when:

    The RFID tag is valid: to light the RGB ring in Green, then to continue working on the backround.
    The RFID tag is not valid: to light up the RGB ring in LED.

    I will try without interrupt and i will add the RFID code inside the main of the RGB code. Will let you know.

  3. #3
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: NeoPixel (WS2812B) Demo

    this is the addition to the main:

    Code:
    serin2 rfid,84,[WAIT($02),str BUF\10]
                                    
    Check_List:
      FOR tagNum = 1 to 3       ' scan through known tags
        FOR idx = 0 TO 9		' scan bytes in tag
        READ (((tagNum-1)*10) + idx), char	' get tag data from table
        IF (char <> buf(idx)) THEN Bad_Char		' compare tag to table
        NEXT
        GOsub Tag_Found			' all bytes match!
    
    Bad_Char:					' try next tag
      NEXT
      
    Bad_Tag:
      tagNum = 0
        FREQOUT porta.3, 1000 */ $100, 115 */ $100	' groan

Similar Threads

  1. PIC to WS2812B / WS2811 IC
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th January 2018, 20:37
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 05:46
  3. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 20:10
  4. Nested For Next Loop Demo
    By Archangel in forum Code Examples
    Replies: 0
    Last Post: - 8th June 2009, 09:57
  5. Demo version...
    By simransingh in forum mel PIC BASIC
    Replies: 4
    Last Post: - 21st November 2007, 22:10

Members who have read this thread : 3

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts