I am having trouble and I can't seem to find help?
- Code: Select all
from time import sleep
import RPi.GPIO as GPIO
door_switch_pin = 23
motion_sensor_pin = 24
#Set up inputs
motion_LED_pin = 18
door_LED_pin = 25
#Set up output LED indicators
pygame.mixer.init(44100, -16, 2, 1024)
prev_door = False
#sound files expect to be in the same directory as script
enter = pygame.mixer.Sound("./enter.wav")
exit = pygame.mixer.Sound("./exit.wav")
#Update sensor and LED states each loop
door = GPIO.input(door_switch_pin)
motion = GPIO.input(motion_sensor_pin)
#When the door is opened, if there is movement outside, it means that someone is entering. If not, someone is exiting
if door and not prev_door:
prev_door = door
When I try to run the script I always get this error;
*** glibc detected *** python: double free or corruption (!prev): 0x015ae258 ***
or some variation on the last number...
I did try with
Occidentalis v0.1 and v0.2, with and without the added electronics.
Always with the same results.
Any help you could offer would be greatly appreciated!
Thank you in advance!