WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: wiringpi  (Read 5734 times)

Offline bellad

  • Jr. Member
  • **
  • Posts: 65
wiringpi
« on: June 30, 2014, 04:47:54 AM »
hello,
hi try wiringpi.tcz on 5.3  , but when i do
Code: [Select]
import wiringpi
ImportError: No module named wiringpi

have you a soluce ?

thank

bellad.flnet.org

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14641
Re: wiringpi
« Reply #1 on: June 30, 2014, 06:06:51 AM »
You're missing either a perl or python module?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: wiringpi
« Reply #2 on: June 30, 2014, 06:25:52 AM »
wiringpi.tcz provides the command line tool and dev libs to manipulate GPIO. No Python module provided, it is the original WiringPi.

What you are looking for is the WiringPi2-Python fork, which is not yet available in the repo.
« Last Edit: June 30, 2014, 06:56:21 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bellad

  • Jr. Member
  • **
  • Posts: 65
Re: wiringpi
« Reply #3 on: June 30, 2014, 09:28:26 AM »
oh , thank
i work python , i get python.RPI.GPIO.tcz and i try

sorry
bellad.flnet.org

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1154
Re: wiringpi
« Reply #4 on: June 30, 2014, 09:50:16 AM »
The old WiringPI does not work with the newer rpi firmware.   version 2 should include the patches.

For Python I use.  RPIO.   http://pythonhosted.org/RPIO/index.html


Offline bellad

  • Jr. Member
  • **
  • Posts: 65
Re: wiringpi
« Reply #5 on: June 30, 2014, 10:14:19 AM »
thank paul
RPIO is not repo ?

my project : by python , use bmc gpio : lcd ( rs -> 10 , e -> 7 , d4 -> 9 , d5- > 25 , d6 -> 11 , d7 -> 8 )
 relay ( x5 ) : re1 -> 4 , re2 -> 17 , re3 -> 18 , re4 -> 27 , re5 -> 22
i use spi and ce pin's for lcd

with wich module the best for python ( RPI.gpio - wiringpi2 - RPIO or other )  ??

thank you
bellad.flnet.org

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1154
Re: wiringpi
« Reply #6 on: June 30, 2014, 06:40:29 PM »
thank paul
RPIO is not repo ?

my project : by python , use bmc gpio : lcd ( rs -> 10 , e -> 7 , d4 -> 9 , d5- > 25 , d6 -> 11 , d7 -> 8 )
 relay ( x5 ) : re1 -> 4 , re2 -> 17 , re3 -> 18 , re4 -> 27 , re5 -> 22
i use spi and ce pin's for lcd

with wich module the best for python ( RPI.gpio - wiringpi2 - RPIO or other )  ??

thank you

RPIO is not in the repo, but it is easy to add yourself.  But I took a look at the GPIO library on the repo.  It is now fairly full featured and supported/updated better.  I would use that.

At the time that I started using my GPIO, RPIO had the interrupt programming, where the basic python GPIO library did not. 

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: wiringpi
« Reply #7 on: July 01, 2014, 04:00:52 AM »
python-RPi.GPIO.tcz updated to latest 5.5 release.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bellad

  • Jr. Member
  • **
  • Posts: 65
Re: wiringpi
« Reply #8 on: July 01, 2014, 04:46:24 AM »
thank paul and markus

i try rpi.gpio , is what manages rpi.gpio bmc gpio : lcd ( rs -> 10 , e -> 7 , d4 -> 9 , d5- > 25 , d6 -> 11 , d7 -> 8 )
beacause no display with my code :
Code: [Select]
#!/usr/bin/python 
     
import RPi.GPIO as GPIO 
from time import sleep 
class HD44780: 
     
    def __init__(self, pin_rs=10, pin_e=7, pins_db=[9,25,11,8]): 
 
        self.pin_rs=pin_rs 
        self.pin_e=pin_e 
        self.pins_db=pins_db 
 
        GPIO.setmode(GPIO.BCM) 
        GPIO.setup(self.pin_e, GPIO.OUT) 
        GPIO.setup(self.pin_rs, GPIO.OUT) 
        for pin in self.pins_db: 
            GPIO.setup(pin, GPIO.OUT) 
 
        self.clear() 
 
    def clear(self): 
        """ Blank / Reset LCD """ 
 
        self.cmd(0x33) # $33 8-bit mode 
        self.cmd(0x32) # $32 8-bit mode 
        self.cmd(0x28) # $28 8-bit mode 
        self.cmd(0x0C) # $0C 8-bit mode 
        self.cmd(0x06) # $06 8-bit mode 
        self.cmd(0x01) # $01 8-bit mode 
 
    def cmd(self, bits, char_mode=False): 
        """ Send command to LCD """ 
 
        sleep(0.001) 
        bits=bin(bits)[2:].zfill(8) 
 
        GPIO.output(self.pin_rs, char_mode) 
 
        for pin in self.pins_db: 
            GPIO.output(pin, False) 
 
        for i in range(4): 
            if bits[i] == "1": 
                GPIO.output(self.pins_db[::-1][i], True) 
 
        GPIO.output(self.pin_e, True) 
        GPIO.output(self.pin_e, False) 
 
        for pin in self.pins_db: 
            GPIO.output(pin, False) 
 
        for i in range(4,8): 
            if bits[i] == "1": 
                GPIO.output(self.pins_db[::-1][i-4], True) 
 
 
        GPIO.output(self.pin_e, True) 
        GPIO.output(self.pin_e, False) 
 
    def message(self, text): 
        """ Send string to LCD. Newline wraps to second line""" 
 
        for char in text: 
            if char == '\n': 
                self.cmd(0xC0) # next line 
            else: 
                self.cmd(ord(char),True) 
 
if __name__ == '__main__': 
 
    lcd = HD44780() 
    lcd.message("Raspberry Pi\n  Take a byte!")
    GPIO.cleanup()
 

oups !!
i do error with plug lcd module
it is good , except that no display what I want
i search why
« Last Edit: July 01, 2014, 07:42:58 AM by bellad »
bellad.flnet.org