Questions tagged [python]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

Filter by
Sorted by
Tagged with
3
votes
3answers
7k views

Multiple Callbacks from GPIO interrupt

I created a quick program that uses the GPIO library to create an interrupt with a callback that is initiated when a (pink) button is pressed. It works, but when the button is pressed and then ...
0
votes
2answers
631 views

Why are the buttons that I am using with my Pi inverted?

I am using an NES as a Pi case. I want to wire the power button to the Pi to do some commands. I have connected one cable to GPIO 1 and another with a 10K Ohm resistor to GPIO 17. I found this command ...
0
votes
1answer
1k views

How to connect slotted opto to raspberry pi?

I am trying to connect slotted opto ( TCST2300 ) to raspberry pi. I would like to receive 1/0 on GPIO input pin. Programming is not a problem but the circuit is. I referred following circuit But it ...
1
vote
1answer
279 views

Are there alternative languages to python for controlling a PiGlow?

I've seen lots of references to python for controlling the display on a PiGlow. Are there any alternative languages available? I could learn python, but if there are others I might use them instead. ...
3
votes
2answers
566 views

Why is 14 (board numbering system) listed as a GPIO pin, and not 13?

>>> RPIO.RPI_REVISION 2 >>> RPIO.GPIO_LIST_R2 (2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, 28, 29, 30, 31) Pin 14 is ground, shouldn't this be pin 13 instead?
1
vote
2answers
577 views

Why does a time delay suddenly fix my code?

I'm trying to demonstrate how using a state machine can clarify the logic of most Raspberry Pi projects. All of the code is available as a gist, but the problem portion is around line 34: while True:...
4
votes
2answers
3k views

Python Synth with Raspberry

I'm trying to create a synth using python with raspberry pi. I've written the code for manipulate the gpio input (i've modified the electronic of an old pianola and connected it to raspberry with the ...
1
vote
1answer
163 views

1 motor spradically stops when going forward

I've based my software on the "Linux User & Developer" (issue 132) robot tutorial (my source code can be found here) and hardware connections according to Adafruits PWM tutorial. The problem is ...
1
vote
1answer
2k views

Gather data from a PLC to a Raspberry Pi running Debian and then broadcast it on internet

I have an Unitronics V570 PLC which takes temperature readings. An Ethernet card enabled PLC is really expensive so I plan to connect the PLC to a Raspeberry PI. How can I use Python functions that ...
0
votes
0answers
30 views

How do I run my PiGlow [duplicate]

After following the steps on this page. I did everything correctly and when I try to run the test.py file it says this: Traceback (most recent call last) : File "test.py" , line 9, in <...
0
votes
1answer
263 views

Pi Glow programming [duplicate]

After following the steps on this page https://github.com/Boeeerb/PiGlow. I did everything correctly and when i try to run the test.py file it says this. Traceback (most recent call last) : File "...
0
votes
4answers
7k views

How do I get a GUI program to run before the login screen?

I have a Python (Tkinter) GUI program that displays fullscreen and shows some pictures. I want the following functionality: When the Pi is booted up, the python program is run with the appropriate ...
19
votes
4answers
34k views

Using Raspberry Pi to control my AC via infrared

When I'm on my way back home from somewhere, I want to be able to switch my AC on a few minutes before I arrive at my apartment, probably by using my phone to connect to my Raspberry Pi on my desk ...
4
votes
2answers
165 views

Are there any major differences when programming of the Pi and for normal Linux

As the title says, are there any major differences in programming with Python on the RPi and a normal PC with linux? And if there are (excluding the GPIO and other platform specific stuff) could you ...
1
vote
0answers
1k views

Slow frame rate when playing video in Pygame

I've been doing some project on playing the videos and could use the button to change the movies selection. I ended up using pygame but the things are when the video has the resolution more than ...
0
votes
4answers
425 views

Programming on Raspberry Pi device? [closed]

I am new with raspberry pi. Actually I am coming from Java background. Which programming should I use for raspberry pi tasks? The choices are given below:- Java Python Kindly suggest me which one of ...
0
votes
1answer
260 views

Display board using raspberry pi

I have to make a display board using raspberry pi. The display board will be showing some sort of counter and 1920x1080 32 inch LCD screen will be used for display. Thus I have decided to use pygame ...
3
votes
1answer
11k views

Extracting required information from NMEA GPS data [closed]

I am using raspberry pi to talk to a NMEA GPS module via serial port, everything works fine but i want to extract only latitude and longitude(i am using python language) coordinates so that i can use ...
2
votes
1answer
3k views

tkinter through VNC without physical display

My setup is: a Raspberry Pi, running the latest Raspbian (fully updated), a self-compiled Python 3.3.3 a Mac running Mavericks (10.9) I'm AFP-ed, SSH-ed and VNC-ed to my RPi, and I can run all the ...
2
votes
2answers
4k views

Issues playing back wav files with pygame

I'm using pygame and I'm trying to play wav files but it's not going great. Code is as simple as: import pygame pygame.mixer.init() pygame.mixer.music.load("01.wav") pygame.mixer.music.play() but I'...
3
votes
1answer
4k views

Installing OpenCV on Raspberry Pi: can't find packages

I'm trying to install OpenCV 2.4.7 on Raspberry Pi (Model B, OS: Raspbian). The guides I'm referring to are: 1. RASPBERRY PI + SIMPLECV + OPENCV + RASPICAM CSI CAMERA 2. Raspberry Pi + OpenCV 3. ... ...
1
vote
1answer
862 views

MMAL Raspberry Pi Speed

Does anyone know if there is a way to improve the speed of taking photos with raspistill? I have a Python program which basically calls "subprocess.call" - I've noticed that the speed of such an ...
2
votes
1answer
8k views

What Version of Python does Raspbian Wheezy comes with?

I would like to ask, What Version of Python does Raspbian Wheezy comes with?
5
votes
1answer
3k views

Hue saturation intensity histogram plot

I am using pi with raspbian wheezy and python 2.7. I have an image in jpg format which I can read and convert to array. But I want to convert the image from RGB color model to HSI color model and then ...
2
votes
2answers
197 views

Making text very readable without X server on a 3.5 inch backup camera monitor

I setup a Pi with a car backup camera monitor and push button. It's for displaying a to-do list that I cycle through by pressing the button. I wrote it for the command-line so I don't have to use X-...
0
votes
1answer
1k views

How to run pygame window on vnc remote desktop?

I have a very simple pygame based script, mainly handling keyboard input and some sounds. The display is mostly useless. I would like to run the script without a display, using vnc(using TightVNC now)....
0
votes
1answer
2k views

Web Interface to Control Robot Arm attached to Raspberry Pi - HOWTO?

I'm currently working on a project to hook up a robotic arm & webcam to my Raspberry Pi and control said arm through a web inteface. I believe the technical work here involves: Connecting the ...
0
votes
1answer
5k views

Monitoring a Python script running in a screen session with Monit [closed]

I have a Python script that uses Twitter's streaming API, but it usually crashes after a day or two. I have not been able to pinpoint the cause, and after more than a month of trying, I've stopped ...
2
votes
4answers
918 views

Which would be faster? Computing 2000 MD5 hashes on the fly or cache them on SD?

Without going much into details, I'll have a Pi working as a game server. Players make requests to that server. For each player, the Pi will have a table of pre-computed MD5 hashes corresponding to ...
3
votes
2answers
18k views

Connecting Raspberry Pi to another device via USB port

I am trying to connect the Raspberry Pi to a microcontroller using the USB Port. I have used the device many times and I know how the protocol works. It should reply after receiving the message that I ...
3
votes
2answers
1k views

OMXplayer pexpect loop screen blacks out

I Run omxplayer in a loop with pexpect via python. After a period of time, the screen blacks out and the pi is unresponsive to keyboard input. I have hostapd running and it responds by sending me back ...
2
votes
1answer
3k views

Python script failing with AttributeError: LED instance has no attribute '__trunc__'

I am currently bread-boarding two LEDs with 560 mOh resistors connected to the RPi over a ribbon cable that connects to the breadboard with a Pi Cobbler. The problem I am getting isn't with the ...
4
votes
3answers
6k views

Automatically start python program at start-up

I am working on a project that needs a special GUI that takes up the full screen. I know I can make the X-Window system start up on boot (using raspi-config then changing the setting) but is it ...
1
vote
1answer
9k views

How to read values with pyserial?

I'm using a CMUCam4 connected to the usb port. So far I've tried this: import serial cam = serial.Serial("/dev/ttyUSB0",19200) cam.write("GV \r") #call get version result = cam.readline() The ...
1
vote
2answers
162 views

Roadmap to leverage RPi to do signal processing from 4 inductive loops and data transmission in an outdoor environment [closed]

I'm currently weighing my options to build a semi-industrial outdoor device, which is aimed to do some signal processing from 4 inductive loops which have been laid in the ground to detect vehicle ...
1
vote
1answer
2k views

Restart Midori IN FULLSCREEN If Network Down

Total noob to RPi and Python... and this message board, for that matter. Please excuse any inappropriate behavior on this, my first posting. The solution provided by xxmbabanexx did EXACTLY what I ...
3
votes
1answer
4k views

How to send MIDI Control Change Message from Python?

I would like to know how can i send MIDI Control Change messages from a Python script to an application called rakarrack, which receives MIDI messages to change volumes, turn on/off FX's, etc. All ...
1
vote
2answers
174 views

Confused about GPIO

I have a PI B and i am having a bit of trouble with my GPIO pins. I am running a simple script to check if a button has been pressed that is hooked up up to pin 7. The problem is as soon as i conntect ...
1
vote
1answer
1k views

Raspberry Pi camera feed is slow

I managed yesterday to hook my "LifeCam VX-800" to my Raspberry Pi. It works just fine, but it's very very slow. I tried adjusting that by decreasing the sleep duration in the code, but that didn't ...
4
votes
2answers
18k views

How do I run a python program as a process in the background?

I have made a little python program that lights up some LEDs to display the current heat of the pi, but I want to run it while I'm doing other stuff. I don't want it to run in a window because I often ...
2
votes
2answers
2k views

What is the Path and Name of a runtime executable?

I am trying to upload an old encryption tool that I created a while ago to the Pi store. I am almost done, but have reached an issue at the Runtime Settings part of the upload. I need to know, what is ...
15
votes
2answers
8k views

How do I read a button through the GPIO?

I considered myself out of this sort of beginner level stuff a long time ago, but I guess I'm not as smart as I thought I was because I seem to be having an exceptional level of trouble with it! So I'...
4
votes
3answers
7k views

Safely Logging Data on Raspberry Pi

Currently I am reading data from a GPS receiver through USB on a raspberry pi and I would want to log this data on the SD card. I am collecting the data through Python by using file = open("file.txt",...
1
vote
1answer
2k views

Opencv on a raspberry PI [closed]

What language would be best to use on a raspberry PI with Opencv. Bearing in mind for each language used : Library updates Development Environment including tool kits Performance ...
0
votes
2answers
1k views

Does anyone know of any Accelerometers that are easy to use in Python

I'm fairly new to GPIO programming and robotics with the Raspberry Pi, and was wondering what I should look out for to avoid pitfalls later when buying an accelerometer. I've heard that the GPIO pins ...
0
votes
1answer
3k views

Has anyone used PyDev in Eclipse on the RasPi?

I'm using PyDev on my Mac and would like my son to be able to use PyDev on the RasPi because it would offer him syntax checking and so on. Has anyone gotten it to work? If so, was it usably responsive?...
-2
votes
1answer
8k views

Is there an equivalent to a 'subroutine' in the Python language? [closed]

What is the syntax for creating, calling, and exiting subroutines in Python?
3
votes
1answer
1k views

Options for a kid to write a 3D game in Python?

I'm a programmer and would like to help my son learn to program a 3D game in Python that can run slowly on the RasPi or quickly on a PC. I thought about using the RasPi edition of Minecraft, but it ...
0
votes
1answer
5k views

Raspberry Pi Python Error

I tried to install distribute or setuptools which has to be done prior to installing pip on the Raspberry Pi. The command used was $ curl http://python-distribute.org/distribute_setup.py | python ...
2
votes
3answers
5k views

Starting Python Program with Screen Automatically

I'm trying to turn a headless Pi into a single purpose computer. The application I wrote uses a ncurses GUI and I want it to start on boot. The program also needs to be run on a separate 'screen' (...