Giter Site home page Giter Site logo

raspio-inspiring's People

Contributors

raspitv avatar tuftii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

raspio-inspiring's Issues

spidev copies received data into tx buffer which corrupts led_values

def write_leds(self):
    """write_leds() writes all stored led_values to LEDs"""
    self.flush_leds()
    for value in self.led_values:
        self.send = spi.xfer(value)
    for x in range((self.numleds // 32) +2):  #check this not overkill
        self.flush_leds()

the latest version of spider copies the received data into the tx variable so the line
self.send = spi.xfer(value)
results in received data being copied into self.send and value. this means that self.led_values also gets modified by the received data, resulting in led_values been set to [0,0,0,0]. So in example03.py the data gets corrupted and only the first led addresses.

I have "fixed" it by adding
import copy at the top of the file
and changing the for loop to

    for value in self.led_values:
        txdata=copy.copy(value)
        self.send = spi.xfer(txdata)

example03 now works. I am not sure if there is a more elegant fix which is why I have not posted me version of apa.py

What GPIO pins are required?

Due to other boards connected to my Pi I can't connect it directly to the GPIO header, so need to just connect whatever pins are needed

Can someone please tell me which ones it uses so I can do so, as not clear from documentation

Thanks

Clock speed needs setting for Raspbian STRETCH

I could not get the code to work on a Raspberry PI0W running stretch, the leds are not being addressed properly.
On the raspberry PI forum I found an issue with the SPI interface on stretch with respect to an A/D. They fixed the issue by setting the clock speed of the interface.

I have "solved" my problem by editing apa.py to add
spi.max_speed_hz = 20000
after the lines
spi = spider.SpiDev()
spi.open(0,1)

I am not a hardware engineer so I do not know what max speed the PI can cope with. The data sheet for the leds specifies up to 30MHz, I have tried with values of 5000, 10000 and 20000. They all work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.