EjectABed Version 2 – Now Using the Raspberry Pi (Part 2)
September 15, 2015 Leave a comment
With the connection from Twitter to the PI working well, I decided to hook up the bed top the PI. The Bed is controlled via a server attached to a bellow that forces air to the screw drive. You can read about how we figured that one out here.
My initial thought was that it would be easy as the Netduino implementation to control the servo was all of 5 lines of code. The Netduino has built-in PWM ports and the api has a PWM class:
1 uint period = 20000; 2 uint duration = SERVO_NEUTRAL; 3 _servo = new PWM(PWMChannels.PWM_PIN_D5, period, duration, PWM.ScaleFactor.Microseconds, false); 4 _servo.Start(); 5 _servoReady = true;