this is definitely a newbie question but I was hoping for a diagnosis.
I’m getting a memory allocation error when running a GPIO setup on my Raspberry Pi, for the purpose of running a servo.
I’d like to run the following code to set up the servo on my Raspberry Pi:
# Import libraries
import RPi.GPIO as GPIO
import time
# Set GPIO numbering mode
GPIO.setmode(GPIO.BOARD)
# Set pin 11 as an output, and set servo1 as pin 11 as PWM
GPIO.setup(11,GPIO.OUT)
servo1 = GPIO.PWM(11,50) # Note 11 is pin, 50 = 50Hz pulse
Whenever I try to run this, I get the following error:
#malloc(): invalid size (unsorted)
Aborted
The servo is brand-new, and I’ve rechecked the pin connections and they look good – any ideas to what’s going on?
-roo
Andrew Mason is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.