Go to advanced search

by vistauser
Mon Mar 18, 2013 8:01 pm
Forum: Python
Topic: Change SPI Speed From Python
Replies: 9
Views: 12497

Re: Change SPI Speed From Python

... good enough for me. Up to now I used the dRGB strip with an Arduino (Uno or Nano) and for this we have a modified Adafruit Library with hardware SPI for ultra-fast writes on pins 11 and 13. mfg Olaf
by adammhaile
Mon Mar 18, 2013 3:40 pm
Forum: Python
Topic: Change SPI Speed From Python
Replies: 9
Views: 12497

Change SPI Speed From Python

I've seen talk of setting SPI to a higher speed but it always seems to be from C/C++ like here: https://projects.drogon.net/understanding-spi-on-the-raspberry-pi/ However, is there a way to set the SPI clock speed higher from within Python? ...
by Scotteh
Tue Mar 05, 2013 8:06 pm
Forum: Python
Topic: Gertboard ADC
Replies: 4
Views: 931

Gertboard ADC

... I've got the temperature sensor working fine however having issues with the light The part to do with light sensor would be; def get_adc(channel): spi = spidev.SpiDev() spi.open(0,0) .... .... if(channel == 0): r = spi.xfer2([1,(2+channel)<<6,0]) adc_val = ((r[1]&31) << 6) + (r[2] >> 2) return ...
by babbage
Sun Mar 03, 2013 8:30 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

Ok, I'm really having to go now!
Tried the second bit of code and I still get the same errors so I guess this is pointing to something SPI related ?
Is it just worth re-imaging and starting from scratch ?

Steve
by texy
Sun Mar 03, 2013 4:44 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... recent call last): File "/home/pi/nokialcd4.py", line 296, in <module> noki = NokiaSPI() File "/home/pi/nokialcd4.py", line 158, in __init__ self.spi.open(self.dev[0],self.dev[1]) IOError: [Errno 2] No such file or directory Any help gratefully received :-) Hi, please bare in mind that Paulie ...
by babbage
Sun Mar 03, 2013 4:15 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... recent call last): File "/home/pi/nokialcd4.py", line 296, in <module> noki = NokiaSPI() File "/home/pi/nokialcd4.py", line 158, in __init__ self.spi.open(self.dev[0],self.dev[1]) IOError: [Errno 2] No such file or directory Any help gratefully received :-)
by texy
Thu Feb 28, 2013 8:05 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... wiringpi.pullUpDnControl(SELECT, wiringpi.PUD_DOWN) wiringpi.pinMode(LED,2) # pwm mode wiringpi.pwmWrite(LED,128) # mid-level def SPI(value): # data = DIN # clock = SCLK # MSB first for i in reversed(xrange(8)): wiringpi.digitalWrite(DIN, (value >> i) & 1) wiringpi.digitalWrite(SCLK, ...
by texy
Thu Feb 28, 2013 5:25 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... getting syntax errors with just declaring constants/variables. How are you running the program? Also note that the v1 shield doesn't use hardware SPI, so editing the blacklist will not effect the running of test program. It sounds like something else more fundamental is wrong with your setup. ...
by paulie
Thu Feb 28, 2013 3:31 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... 3 RST = 0 # gpio pin 11 = wiringpi no. 0 (All after RST line has been snipped) I have edited raspi-blacklist.conf to remove blacklisting of I2C & SPI, and installed python-dev python-imaging python-imaging-tk python-pip Then did a pip install of wiringpi and spidev where else am I going wrong?
by texy
Fri Feb 15, 2013 12:44 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... if you want. I believe my local sorting office has a package for me which will be the v3 pcb's - these will have the correct tracking in for SPI without mod's (if I got the layout correct :lol: ). If you are happy to desolder your lcd from it's original pcb, I could send you just the replacement ...
by sportsnapper
Fri Feb 15, 2013 11:44 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

Yes, but one of the old ones, before the SPI code was released. I also got a 'bare' one from eBay (2.98!) -that's the one in the picture. I'm going to try to patch your lcd connectors into my breadboard, but don't have the right leads (or a schematic ...
by sportsnapper
Fri Feb 15, 2013 10:26 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

Well, success, I've got this working using the nokia_spi code. Thanks to Bill. Pic attached - I used the Quick2wire interface board, and hooked up their spi interface to the Nokia, as well as using the gpio pins, which handily have the same pin assignment ...
by alexeames
Thu Feb 14, 2013 4:10 pm
Forum: Python
Topic: RPi.GPIO not working
Replies: 12
Views: 10347

Re: RPi.GPIO not working

... have either RPi.GPIO or WiringPi for Python installed (or both). To use the digital to analogue and analogue to digital converters, which use the SPI bus, you need to install a module called py-spidev. Instructions for how to do this are included with the Python programs. The instructions are ...
by bgreat
Thu Feb 14, 2013 12:53 am
Forum: Python
Topic: pwm control from python
Replies: 6
Views: 2351

Re: pwm control from python

WiringPi has everything you need for PWM control via Python. I use it with my Nokia SPI display to control the back light brightness. The thread on the forums has the code. Here is a quick excerpt for using the PWM: #!/usr/bin/env python import wiringpi #gpio's : ...
by bgreat
Sat Feb 09, 2013 6:12 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

Did a quick update to the C++ code posted above by Sector7CSD to use the spidev hardware interface. This is a quick hack and proof of concept and could use more/better error handling... main.cpp: // main.cpp // code by: Chris // --------------------------------------------------------------------- ...
by bgreat
Fri Feb 08, 2013 6:55 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

texy wrote:That's cool!
I know very little of C++ - is it actually using hardware SPI ?

Texy
It's banging the bits. :) It would be easy to convert to use hardware SPI though. ;) Maybe a weekend project for me...

Enjoy!
Bill
by texy
Fri Feb 08, 2013 6:21 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

That's cool!
I know very little of C++ - is it actually using hardware SPI ?

Texy
by Sector7CSD
Fri Feb 08, 2013 6:12 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

... b3; data[3] = b4; data[4] = b5; } }; map<BYTE, pixeldata_s> fontmap; // --------------------------------------------------------------------- void SPI(BYTE value) { // data = DIN // clock = SCLK // MSB first for(unsigned int i=0; i<8; i++) { digitalWrite(DIN, (value >> (7-i)) & 1); digitalWrite(SCLK, ...
by Alan Johnstone
Fri Feb 08, 2013 2:54 pm
Forum: Python
Topic: Finding Info on libraries
Replies: 3
Views: 1032

Re: Finding Info on libraries

... know much about subprocesses (and many other things!) import os import gps import time import threading import copy from pickle import * # reload spi drivers to prevent spi failures import subprocess try: kill_gpsd = subprocess.Popen('sudo killall gpsd', shell=True, stdout=subprocess.PIPE) except: ...
by mcv100
Fri Feb 08, 2013 2:37 pm
Forum: Python
Topic: i2c LED CPU meter
Replies: 11
Views: 3960

Re: i2c LED CPU meter

Here is the SPI code, again, make sure you have the right module (Py-spidev). Connect the first 8 leds to the outputs of the first 595 (from A-H), then connect the serial out of that one to the second 595, and connect the last 8 ...
by cae2100
Fri Feb 08, 2013 12:16 pm
Forum: Python
Topic: i2c LED CPU meter
Replies: 11
Views: 3960

Re: i2c LED CPU meter

cool project, I was looking for something like this a while back. Do you mind posting the code and such for your spi version? Im really interested in using the 595 with a project of mine and would love to see your schematics and code.
by mcv100
Thu Feb 07, 2013 4:01 pm
Forum: Python
Topic: i2c LED CPU meter
Replies: 11
Views: 3960

i2c LED CPU meter

... the current CPU usage. A video of the meter in use can be found here . This was my first "project" for the RPi. I've changed it now so it uses SPI and some 74HC595 shift registers (coding is only a little bit different). That was a simple SPI test for my upcoming project: an 8x8x8 LED cube ...
by texy
Sun Feb 03, 2013 11:16 am
Forum: Python
Topic: Nokia Pi Shield board code
Replies: 0
Views: 3626

Nokia Pi Shield board code

... pull down resistors of the Pi and again uses wiringpi for python. Unfortunately I was not able to change the pcb design to utilise hardware SPI before they went to the fab house for this revision, so the code to drive the display is unchanged. #!/usr/bin/env python # -*- coding: utf-8 -*- ...
by MiloPi
Mon Jan 28, 2013 2:27 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

Hi,

I trying to wire my raspberry to Lcd 3310, but I'm sure how wired raspberry, I don't want damage it. I dont understand wires? is emulated spi? why? Can you give me a schematic? I'dont find any.

I'm sorry for my English.
thanks a lot.
by bgreat
Mon Jan 28, 2013 12:28 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 118397

Re: Nokia Pi LCD

It is not specific to the LCD code, so you can use it any time you want to reset the SPI configuration. This is why I posted separately, grouped the code at the top of the file. It can be called any time before or after opening the spidev channel. I placed it after ...

Go to advanced search