07-13-2017, 10:59 PM
(07-13-2017, 01:14 PM)casmiguefl Wrote: I'm finding it impossible to work with GPIO and wanted to connect a small servo motor to the Pine64 in order to control it.
In this particular case I want to set 2 particular degrees depending on a variable.
With an Arduino, this is basic: Servo.attach(#controlpin); Servo.write(#angle);
Any tutorials around on how to do it here?
For the servos, no, I don't think so. Most of the documentation is for simple GPIO stuff like on/off toggling and I/O expansion. Whilst it should be possible drive the servos from the pine64 using soft pwm (based on the ideas from this posts code), I don't know how successful you will be, as SBCs are not that good for accurate timing signals... You are much better off using a dedicated IC (i.e. a ATTny85 programmed to work in conjunction with the pine64, which can provide the necessary accurate PWM signals for the servo, or an Arduino Pro Mini). But if you want to give a go to see what the pine64 can do anyway, that's great too!