Go to advanced search

by bgreat
Wed Jan 30, 2013 1:15 pm
Forum: General discussion
Topic: Reading Voltages
Replies: 4
Views: 2121

Re: Reading Voltages

If all of the inputs are to support -5 V to 12 V DC range, you can use a simple resistor divider and a single sided converter. A 10-bit converter would give approximately 0.02 V DC single bit resolution if used with a divider providing a 20 VDC range. An 8-bit converter would give approximately 0.1 ...
by bgreat
Wed Jan 30, 2013 1:00 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using hardware PWM in python
Replies: 4
Views: 22225

Re: Using hardware PWM in python

Gordon posted as I was typing... :lol:

And yes, you must run the application as root for the GPIO access.

Enjoy!
Bill
by bgreat
Wed Jan 30, 2013 12:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using hardware PWM in python
Replies: 4
Views: 22225

Re: Using hardware PWM in python

Gordon's WiringPi has a Python interface and supports the hardware PWM. I use it with my LCD backlight to control the brightness. Code snippet for LED control: #!/usr/bin/python import wiringpi LED = 1 # gpio pin 12 = wiringpi no. 1 (BCM 18) # Initialize PWM output for LED wiringpi.wiringPiSetup() ...
by bgreat
Wed Jan 30, 2013 12:40 pm
Forum: C/C++
Topic: kernel modules
Replies: 2
Views: 1378

Re: kernel modules

By default the i2c and spi modules are not loaded. This avoids a conflict for those who want to have maximum available GPIO pins. To have the i2c and spi modules load at boot, you need to remove them from the boot blacklist. Edit /etc/modprobe.d/raspi-blacklist.conf and add a '#' character in front ...
by bgreat
Wed Jan 30, 2013 4:00 am
Forum: Python
Topic: Sending Email Using Python and Gmail
Replies: 24
Views: 34432

Re: Sending Email Using Python and Gmail

malakai wrote:Not sure but do you have email.py in the same folder as the code your running if so won't python pick that up first invalidating the email.py that your trying to import?
Good catch. That would definitely cause the error.

Enjoy!
Bill
by bgreat
Wed Jan 30, 2013 3:00 am
Forum: Python
Topic: Sending Email Using Python and Gmail
Replies: 24
Views: 34432

Re: Sending Email Using Python and Gmail

First, you should update your Raspbian installation by running the following commands on your Raspberry Pi: sudo apt-get update sudo apt-get -y upgrade This should solve your import problem. Until that is corrected, the program can not work. Second. What editor did you use to create 'email_startup.p...
by bgreat
Wed Jan 30, 2013 1:01 am
Forum: Python
Topic: Sending Email Using Python and Gmail
Replies: 24
Views: 34432

Re: Sending Email Using Python and Gmail

ShadowEEngineer wrote: Lastly, When I only type "import smtplib" in the python shell, it returns an error.
This indicates that you may have an installation problem. If you are not running the most recent Raspbian image, I would recommend you update your installation and try your script again.

Enjoy!
Bill
by bgreat
Wed Jan 30, 2013 12:53 am
Forum: Python
Topic: Sending Email Using Python and Gmail
Replies: 24
Views: 34432

Re: Sending Email Using Python and Gmail

First thing. What Linux distribution are you using? Doing a quick review of the code, I see a syntax error here: ... smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo ... The third line above should be: smtpserver.ehlo() The missing '()' will result in an error. With the correction, your scrip...
by bgreat
Tue Jan 29, 2013 7:31 pm
Forum: Python
Topic: Special signs in python.
Replies: 5
Views: 958

Re: Special signs in python.

See this thread with the same question, and working example.

How to make symbold in LCD

Enjoy!
Bill
by bgreat
Mon Jan 28, 2013 12:28 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

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 the open in the nokiaSPI code beca...
by bgreat
Mon Jan 28, 2013 4:10 am
Forum: Python
Topic: User Input
Replies: 2
Views: 830

Re: User Input

I am assuming your indentation is correct... The way your while is written, it will always evaluate as true. It evaluates the comparison "askanything1 == 'How are you?'". If that is not ture, then it evaluates "'how are you'". Since that is a defined string, it always evaluates as true. With an 'or'...
by bgreat
Mon Jan 28, 2013 2:06 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

OK. Here is a Python solution without calling external applications to reload the driver. It basically tests that the SPI GPIO pins are configured for the proper operation. If not, it prints a warning and updates the configuration. SPI configuration test/update: # For SPI configuration test import o...
by bgreat
Mon Jan 28, 2013 12:07 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

The 'subprocess' solution works, but is not elegant. ;)

I am working on a Python solution now. It is working for me, but I want to do some more testing before I post the code.

Enjoy!
Bill
by bgreat
Sun Jan 27, 2013 3:30 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

One thing I,ve noticed is that my 'old' code, one that uses the right wiring for SPI, but that does not use the spidev routines will upset subsequent use of the the spidev versions of the code. The spidev code will run without errors, but you'll get a blank screen. If the Pi is rebooted, and the sp...
by bgreat
Sun Jan 27, 2013 2:46 am
Forum: Other projects
Topic: C code to run an hd44780 16x2 lcd
Replies: 6
Views: 4062

Re: C code to run an hd44780 16x2 lcd

Great news! :D

Enjoy!
Bill
by bgreat
Sun Jan 27, 2013 2:42 am
Forum: Other projects
Topic: C code to run an hd44780 16x2 lcd
Replies: 6
Views: 4062

Re: C code to run an hd44780 16x2 lcd

The initialization sequence to put the display in 4-bit mode is incorrect. From the data sheet and AdaFruit code, it should be: writeBytes(&header, 0x33, 0); //Initialization sequence ... writeBytes(&header, 0x32, 0); //... for 4-bit mode interface writeBytes(&header, 0x28, 0); //... 2 line mode wri...
by bgreat
Sat Jan 26, 2013 1:32 pm
Forum: Python
Topic: Problem with text on lcd 2*16.
Replies: 11
Views: 1793

Re: Problem with text on lcd 2*16.

With the AdaFruit code, you can use any pins you choose, but you must update the source for the pins you are using or pass the pins in the arguments when creating your class instance. The pins used by default have no special significance.

Enjoy!
Bill
by bgreat
Fri Jan 25, 2013 2:35 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

I don't "do" github currently. I have attached the sources I used for testing to this message as nokimagpi.tar.gz. Should be simple to download and extract. -rw-r--r-- pi/pi 734 2013-01-24 20:06 MagPi-nokia-bw-rotated-mc.bmp -rw-r--r-- pi/pi 653 2013-01-24 21:30 magpi.py -rw-r--r-- pi/pi 10848 2013-...
by bgreat
Fri Jan 25, 2013 1:16 am
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

To tzj:

I downloaded and tried the MagPi image. Other than being upside down, it displays correctly. If you are still having problems, maybe try reducing the speed setting when initializing the class.

Enjoy!
Bill
by bgreat
Thu Jan 24, 2013 11:58 pm
Forum: Français
Topic: écran LCD nokia 5110
Replies: 16
Views: 3012

Re: écran LCD nokia 5110

Le code fonctionne avec le Rev 1 et Rev 2 du Modèle B Raspberry Pi. Il convient également de travailler avec l'Un modèle quand il est disponible. Entre le Rev 1 et Rev 2 planches, la plus grande préoccupation est le GPIO 21/27 et le changement de l'interface I2C canal 0 sur le canal 1. Je n'utilise ...
by bgreat
Thu Jan 24, 2013 10:11 pm
Forum: Français
Topic: écran LCD nokia 5110
Replies: 16
Views: 3012

Re: écran LCD nokia 5110

Merci pour l'information. J'avais reçu un PM plus tôt aujourd'hui de l'aide et supposé que c'était à cause de mes exemples Python. Mon travail avec le Pi Rapberry a été la plupart du temps en Python, donc c'est ce que j'avais l'habitude de répondre à la requête. Programmation en C/C++ doivent utilis...
by bgreat
Thu Jan 24, 2013 7:51 pm
Forum: Français
Topic: écran LCD nokia 5110
Replies: 16
Views: 3012

Re: écran LCD nokia 5110

Bonjour, Je vais essayer de revoir ce soir et après quelques suggestions. Le seul élément certain nombre, c'est que votre câblage correspond pas au code. Ceci est particulièrement important pour l'utilisation de l'interface SPI que les broches de matériel de communication sont prédéfinis. Le réglage...
by bgreat
Thu Jan 24, 2013 7:33 pm
Forum: Python
Topic: Problem with text on lcd 2*16.
Replies: 11
Views: 1793

Re: Problem with text on lcd 2*16.

To help with this type of problem, it necessary for you to post your code. Please use the 'Code' tags in the message to preserve your formatting.

Enjoy!
Bill
by bgreat
Thu Jan 24, 2013 1:02 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

It looks like another reason not to work to late at night... another head slapping moment: it looks like the contrast setting in nokiaSPI.py was the cause ... The NokiaSPI class default contrast values can be changed when you create your display instance along with other settings: As an example: no...
by bgreat
Thu Jan 24, 2013 12:36 pm
Forum: Python
Topic: Nokia Pi LCD
Replies: 253
Views: 110255

Re: Nokia Pi LCD

tzj wrote:This should be it.
I see nothing wrong with the image format. I will try it this evening when I get home to my Pi.

Enjoy!
Bill

Go to advanced search