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.

Official website http://www.python.org/

3193 questions
1
vote
1 answer

The Current in mA at 3.3 V When Using the Internal Pull-up Resistors

I'm using RPi.GPIO in Python 3. If I do GPIO.setup(24, GPIO.OUT, pull_up_down=GPIO.PUD_DOWN) GPIO.output(24, 1) will then a current flow internally from the pin to ground even if it is not connected? If I do GPIO.setup(24, GPIO.OUT,…
mobluse
  • 181
  • 7
1
vote
1 answer

GPIO Input fluctuating between high and low when no input is received

I've got a fairly simple circuit that I've made where a motion detector is connected to a Raspberry Pi B+ GPIO by way of a fairly long ~30ft stretch of wire. The detector is being powered by a 9V battery and the schematic is as follows: I'm running…
globby
  • 111
  • 3
1
vote
1 answer

How to connect into spotify

I was wondering how can I create a raspberry pi spotify streamer where I can stream my music to and then can control leds with the music frequency.
Marcello B.
  • 127
  • 7
1
vote
0 answers

Python attribute error with Raspberry Pi Camera

I have been coding a python 3 program which allows a user to easily take pictures with the raspberry pi camera. The program works up to the Camera_Capture method which takes the picture. When it is run I get this error: if…
Darth Vader
  • 4,156
  • 24
  • 43
  • 69
1
vote
2 answers

When i set the GPIO pin as output in my python cgi script, after that line my browser does not execute the cgi script. Why?

import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(18, GPIO.OUT) print "

line 4

" The above does not print line 4 in client's browser
1
vote
2 answers

Using Python to control the Raspberry Pi Camera

I have started coding a program in Python 3 for the Raspberry Pi Camera, here is what my code looks like: import picamera, time def Picture_Name_Settings(): pic_name = input("To name the image input N\nTo use automatic naming input A ") …
Darth Vader
  • 4,156
  • 24
  • 43
  • 69
1
vote
0 answers

Midori change URL without new tab

I am trying to change the url of the midori browser after predefined intervals. import os import subprocess import time cmdline = ["midori", "-e", "Fullscreen", "-a","http://www.foo.bar"] p = subprocess.Popen(cmdline) time.sleep(10) cmdline =…
1
vote
1 answer

How to shutdown GPIO elegantly when using kill to stop Python script running in the background?

I'm using GPIO in a Python script, and I've wrapped my code in a try... except block so that GPIO is exited elegantly if I need to abort the script: GPIO.setup(17, GPIO.OUT) # Configure GPIO so that an LED can be lit try: GPIO.output(17, True)…
Stephen Lead
  • 327
  • 1
  • 5
  • 12
1
vote
0 answers

Raspberry Pi stream video over RF

I would like to stream video from a Raspberry Pi over RF to another Raspberry Pi. Here are a few requirements: Range of at least 1KM (pretty much line of sight) I would also like to send some data along with the stream - or simply another packet…
developius
  • 288
  • 3
  • 17
1
vote
0 answers

pymodbus to read temp from device

I am trying to us pymodbus to read data from a temperature and pressure device, but it seems the output from my readings is always None. Here is my code import pymodbus import serial from pymodbus.pdu import ModBusRequest from pymodbus.client.sync…
shane
  • 11
  • 2
1
vote
0 answers

Python serial script prevents android connection

The python script below connects via "rfcomm0" to the "Bluefruit EZ-link module" on the "Arduino Uno" but prevents the bluetooth connection from my android app. If I change the script to use "/dev/ttyACM0" all is well. "serial_test.py"…
1
vote
2 answers

I2C LCD detected, code runs, but no display

I'm trying to drive a 16x2 LCD board with i2c and running into some unexpected results. Basically, I can detect it, talk to it with my code, but nothing shows up on the screen. Same screen when driven by an Arduino works fine, so I know it's OK…
Tim Holt
  • 175
  • 1
  • 7
1
vote
1 answer

Receiving junk datas from the serial port of raspberry pi

Iam doing a project in which i need to read datas send from a ZIGBee through the serial port of raspberry pi. I have done removing that ttyAMA0 stuffs from /dev/cmdline.txt and commented that line in /etc/inittab . Then i reboot the pi. After that i…
Rahul Ramesh
  • 11
  • 1
  • 4
1
vote
1 answer

How to set up MPU6050's registers properly?

I would like to use the MPU6050 as IMU in my quadcopter. I've been Googling for 2 days, but I can't find anything where this is explained well. I know that the settings are not general, but I hope there exists something like a scheme. I've read…
Alex
  • 95
  • 2
  • 10
1
vote
1 answer

png file in same folder as pygame file but not working

So i am on raspberry pi 2 and I am trying to make a game and i have the .py file in the same folder as the png but its still not working. it gives me this error: Also im using pycharm /usr/bin/python2.7 /home/pi/Documents/QFTPC.py Traceback (most…
user27834
  • 11
  • 1
  • 3
1 2 3
99
100