sunfounder / sunfounder_superkit_python_code_for_raspberrypi Goto Github PK
View Code? Open in Web Editor NEWSunfounder Super Kit Python code for Raspberry Pi
Sunfounder Super Kit Python code for Raspberry Pi
Is the code running on python3? I use it on a RaspberrPi Zero with manjaro-arm. I know you only support Raspbian. But for example the "print" command is different from python2 to 3 and I had to convert it.
So my question which pythton version is supported?
hello, when running the example python script for the ADXL345 it generates:
IOERROR: [Errno 2] No Such File Or Directory
Just heads up, there is something wrong in this python code as C based sample works ok(so I know wiring is correct). Just get some garbage in screen.
Is it possible to provide a coherent programming syntax in all the examples? It would be a great improvement, as for example 01_led_1.py
and 02_btnAndLed_2.py
follow quite different programming styles, which could be difficult to understand for python beginners.
When I ran this from the command line, it worked.
However when I went to change the time.sleep and ran it from the shell (Python 3.4.2 Shell), it threw up an error saying it was missing parentheses. I put parentheses around the '...led on' and 'led off...' and it worked on both.
I am new to Python, is this just related to the Shell that comes with Raspberry Pi?
Hello again,
the dice.py does not work because there are only methods declared, it seems the initial main is missing and also the destroy() method.
regrettably if i execute this script nothing happends :/
can you please provide a fix for that ?
I have a question regarding the 10_74HC595_LED,py script's line 47 where it seems to write 0x80 or 128 to the DS/SDI pin on the 74HC595 chip once every eight loops through the def_hc595_in(dat) function.
I understand that 0x80 is sent to the serial Data serial in pin on the 74HC595 chip for conversion to parallel output on the 8 pins driving the 8 LEDs, at a different position in the sequence of 0-7 (bin) for each of the eight data words in the WhichLeds list. I just cannot quite yet comprehend how that lights a different LED each time through. If you put in a 128, shift that with a positive transiton of SRCLCK/the SHCP pin via pin 13 on the GPIO, wouldn't that always light the second or the seventh LED over and over again instead of sequencing through lighting all eight LEDs, e.g. once every 8 loops, per data serial in word, in of 128 total loops. per call of the def loop() function?
The code in the 10_74HC595_LED.py function/script clearly works well and succeeds lighting each of the eight LEDs first left to right, then right to left, then repeat both over and over, How the program logic invoked with the the loop, hc595(dat) and hc595_out() functions in the 10_74HC595_LED.py script actually achieves this is still more than a bit mysterious to me.
I am hoping that anyone who understands how this code logic actually works could find the time in their busy schedule to break this bit of the program execution logic and how it interacts with the 74HC595 chip to achieve these operational results down and reply in kind with a bit of low-level clarification and detail.
I have a question regarding the 10_74HC595_LED,py script's line 26 where it seems to write 0x80 or 128 to the DS/SDI pin on the 74HC595 chip once every eight loops through the def_hc595_in(dat) function.
I understand that 0x80 is sent to the serial Data serial in pin on the 74HC595 chip for conversion to parallel output on the 8 pins driving the 8 LEDs, at a different position in the sequence of 0-7 (bin) for each of the eight data words in the WhichLeds list. I just cannot quite yet comprehend how that lights a different LED each time through. If you put in a 128, shift that with a positive transiton of SRCLCK/the SHCP pin via pin 13 on the GPIO, wouldn't that always light the second or the seventh LED over and over again instead of sequencing through lighting all eight LEDs, e.g. once every 8 loops, per data serial in word, in of 128 total loops. per call of the def loop() function?
The code in the 10_74HC595_LED.py function/script clearly works well and succeeds lighting each of the eight LEDs first left to right, then right to left, then repeat both over and over, How the program logic invoked with the the loop, hc595(dat) and hc595_out() functions in the 10_74HC595_LED.py script actually achieves this is still more than a bit mysterious to me.
I am hoping that anyone who understands how this code logic actually works could find the time in their busy schedule to break this bit of the program execution logic and how it interacts with the 74HC595 chip to achieve these operational results down and reply in kind with a bit of low-level clarification and detail.
dice.py is missing for Project 11
The python code uses two vectors of 20 values to draw its diagram (the C code has both 8 values commented out or 20 values). It is hard for me, though, how to devise a drawing based on those HEX values and how to avoid ghosting.
https://github.com/sunfounder/Sunfounder_SuperKit_Python_code_for_RaspberryPi/blob/master/12_dotMatrix.py
I would advise strongly to update the code on github in order to make it easier for one to draw in binary, like a sprite, and a proper cleanup function. If I try to do any change on the values, the display stops responding and I have to do a full power off.
Something like this: http://blog.riyas.org/2013/12/online-led-matrix-font-generator-with.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.