piface / pifacecad Goto Github PK
View Code? Open in Web Editor NEWPiFace Control and Display
License: GNU General Public License v3.0
PiFace Control and Display
License: GNU General Public License v3.0
Hi,
I did a rpi-update this week (and I get the kernel 4.9.51) on Raspbian GNU/Linux 9 and the Piface Control and Display does not work anymore :
pi@raspberrypi:~ $ python /usr/share/doc/python-pifacecad/examples/sysinfo.py
Traceback (most recent call last):
File "/usr/share/doc/python-pifacecad/examples/sysinfo.py", line 61, in <module>
cad = pifacecad.PiFaceCAD()
File "/usr/lib/python2.7/dist-packages/pifacecad/core.py", line 50, in __init__
self.init_board()
File "/usr/lib/python2.7/dist-packages/pifacecad/core.py", line 80, in init_board
h=self.hardware_addr, b=self.bus, c=self.chip_select))
pifacecad.core.NoPiFaceCADDetectedError: No PiFace Control and Display board detected (hardware_addr=0, bus=0, chip_select=1).
I think that there is an error in de documentation in the part:
Examples-Basic usage-Interrupts. The part on the end: 'The Event object....' says:
import pifacecad
cad = pifacecad.PiFaceCAD()
listener = pifacecad.InputEventListener(chip=cad)
listener.register(0, pifacecad.IODIR_RISING_EDGE, print)
listener.activate()
I did try that but I get the error: AttributeError: 'module' object has no attribute 'InputEventListener'.
Is this a typo in the documentation,or is it an error in the module?
I replaced 'InputEventListener' with 'SwitchEventListener' and it works out fine. I get indeed the output on my screen.
http://piface.github.io/pifacecad/reference_tools.html#module-pifacecad.tools.scanf
pifacecad.tools.LCDScanf
should read
pifacecad.tools.scanf.LCDScanf
The packages for pifacecad are simple NOT there anymore. Furthermore I would like to see jessie being supported.
bin/pifacecadsysinfo.sh
is missing a #!/bin/bash
or /usr/bin/env bash
which ever you preffer.
Yes, I can figure out what pins are being used, from the library, or by hooking up my scope. But I would rather have a nice schematic. Where is it please? Am I missing it?
I can't handle this problem >> 'unable to locate package python3-pifacecad'
I search this issue and try some solutions. but....X(
/etc/apt/sources.list is
deb http://raspbian/raspberrypi.org/raspbian buster main contrib non-free
deb-src http://raspbian/raspberrypi.org/raspbian buster main contrib non-free
It is My first time using raspberrypi so..
i just >>booting >> typing "sudo apt-get update""sudo apt-get upgrade "
"sudo apt-get install python3-pifacecad "
What am I missing????
Hi,
Today, I migrate Raspbian to Stretch and I can not found python-pifacecad or python3-pifacecad packages anymore. I also try to install the deb from GitHub, but I have an error when I try to install python3-lirc (python3 package seams to be too new for this package).
I found the lirc instructions failed as Cython3 is missing
To address the version dependency I did a clean build -> pip3 install cython
Hi,
The example sysinfo.py is broken on stretch, it looks like the format of the command "free" has changed and this is breaking the script.
This is thrown back at me.
Traceback (most recent call last):
File "/usr/share/doc/python3-pifacecad/examples/sysinfo.py", line 75, in
show_sysinfo()
File "/usr/share/doc/python3-pifacecad/examples/sysinfo.py", line 56, in show_sysinfo
cad.lcd.write(":{}".format(get_my_free_mem()))
File "/usr/share/doc/python3-pifacecad/examples/sysinfo.py", line 35, in get_my_free_mem
used_mem = float(run_cmd(USED_MEM_CMD))
ValueError: could not convert string to float:
Regards,
I am trying to use the IR receiver in piface cad but working with the example on page 6 of the latest documentation I can find (2.0.7) when you type in the last command listener.activate() python disappears.
Anyone know the solution?
Hi,
I'm having problems reproducing the first example under Interrupts section with the SwitchEventListener. Switch numbers are not appearing on the display, but not error message is given.
On python 3.4.2 IDLE, with 2016-02-03 raspbian-jessie
Any help appreciated
If I try the IR receiver example on page 6 of documentation release 2.0.7
(I have modified lircrc at //etc/lirc , didn't understand $ cat ~/.lircrc)
When I get to the line
listener = pifacecad.IREventListener(prog="pifacecadexample")
I get an error message that I think is to do with multiprocessing but I am new to Python. I have put the whole error message in a post under the Python section of the Rapberry Pi forum
while trying to execute the sysinfo.py example I get this error...
pi@raspberrypi:~ $ python ./pifacecad/examples/sysinfo.py
Traceback (most recent call last):
File "./pifacecad/examples/sysinfo.py", line 75, in <module>
show_sysinfo()
File "./pifacecad/examples/sysinfo.py", line 56, in show_sysinfo
cad.lcd.write(":{}".format(get_my_free_mem()))
File "./pifacecad/examples/sysinfo.py", line 35, in get_my_free_mem
used_mem = float(run_cmd(USED_MEM_CMD))
ValueError: could not convert string to float:
pi@raspberrypi:~ $
pi@raspberrypi:~ $ python3 ./pifacecad/examples/sysinfo.py
Traceback (most recent call last):
File "./pifacecad/examples/sysinfo.py", line 75, in <module>
show_sysinfo()
File "./pifacecad/examples/sysinfo.py", line 56, in show_sysinfo
cad.lcd.write(":{}".format(get_my_free_mem()))
File "./pifacecad/examples/sysinfo.py", line 35, in get_my_free_mem
used_mem = float(run_cmd(USED_MEM_CMD))
ValueError: could not convert string to float:
pi@raspberrypi:~ $
The issue is very similar to piface/libpifacecad#1
In the python library, is the an equivalent of DELAY_SETTLE_NS that we can use? I tried issuing sleep(1), while it helped, it did not fully solve the issue.
This issue occurs with an app that refreshes the screen every second.
Do you have general recommendations or knobs that can be tweaked from the python api?
The current installation instructions for RPi should be rewritten to use a virtual environment instead. Or anything else than sudoing setup.py or pip really
For both security and package management reasons
I am trying to use the SwitchEventListener as shown in the documentation but it doesnt seem to do anything, the program just hangs.
Only updated on button 5.
I am trying to install pifacecad on a RPi1 with Rasbian Buster Lite.
Following the of this main page there seems to be an error...
$ sudo aptitude install liblircclient-dev cython gcc python{,3}-setuptools python{,3}-dev
This doesn't work, should this be
$ sudo apt-get install liblircclient-dev cython gcc python{,3}-setuptools python{,3}-dev
LCD scanf doesn't work with newline character in text. The text will print in the correct place, but when using the rocker switch to flick through the different settable values, they will be off screen and move the viewing area to where they would be located if the newline character wasn't there.
eg:
scanner = pifacecadtools.LCDScanf("text here \n text %3i > %3i%r")
result= scanner.scan()
I created a little bit more complex Internet Radio project that the one in this repo: https://github.com/tscislo/internet-radio-raspberry-pi Maybe the author of this repo would like to cooperate?
import pifacecad
if __name__ == '__main__':
cad = pifacecad.PiFaceCAD()
cad.lcd.backlight_on()
while True:
cad.lcd.write("Hello EMC!")
Causes:
Traceback (most recent call last):
File "pfcad_emc.py", line 9, in <module>
cad.lcd.write("Hello EMC!")
File "/usr/lib/python3/dist-packages/pifacecad/lcd.py", line 438, in write
self.set_ddram_address()
File "/usr/lib/python3/dist-packages/pifacecad/lcd.py", line 350, in set_ddram_address
address = self.colrow2address(col, row)
File "/usr/lib/python3/dist-packages/pifacecad/lcd.py", line 393, in colrow2address
return col + ROW_OFFSETS[int(row)]
IndexError: list index out of range
After a short while.
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.