Adafruit Learn example for servo + raspberry pi not working?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lyric8
 
Posts: 2
Joined: Sat Oct 15, 2016 4:43 pm

Adafruit Learn example for servo + raspberry pi not working?

Post by lyric8 »

I'm going through the learn raspberry pi tutorials and this one doesn't appear to be working or I am in error. https://learn.adafruit.com/adafruits-ra ... rvo-motor/

It starts by saying the GPIO pin 18 will work for this on the hardware page, but makes no mention of pin 18 in the code at all. The code is also inconsistent for the set("mode") line between the top and the bottom of the software page. My script spits out "Error writing to: servo value: x" with x being an infinite loop between 0 and 180.

Can someone explain what I am missing? I'm sure it is something small, but the tutorial may need to be cleaned up or more explanatory as this is for noobs ;-)

User avatar
caternuson
 
Posts: 92
Joined: Thu Aug 25, 2016 5:54 pm

Re: Adafruit Learn example for servo + raspberry pi not work

Post by caternuson »

Does this directory exist?

/sys/class/rpi-pwm/pwm0/

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Adafruit Learn example for servo + raspberry pi not work

Post by adafruit_support_mike »

That tutorial is no longer accurate. The PWM signal on GPIO 18 stopped working when Raspbian moved from the Wheezy kernel to Jessie.

These days, you have to use software PWM, using a library like Rpi.GPIO.

User avatar
lyric8
 
Posts: 2
Joined: Sat Oct 15, 2016 4:43 pm

Re: Adafruit Learn example for servo + raspberry pi not work

Post by lyric8 »

Thank you. I thought I was taking crazy (strangely banned word, but you all know the phrase from Zoolander). I submitted the feedback that the tutorial is broken. Gracias!

User avatar
adafruit2
 
Posts: 22149
Joined: Fri Mar 11, 2005 7:36 pm

Re: Adafruit Learn example for servo + raspberry pi not work

Post by adafruit2 »

tutorial has been rewritten for modern raspbian, thx!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”