Page 139 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 139

118     Bu il d  Y o ur  O w n  Q u a d c o p t e r


                             ‘  Modified to drive a Brushless Motor using an ESC/BEC motor
                             controller.
                             ‘  Note a BEC type ESC supplies 5V on the center servo pin (some
                             servos are different).
                             ‘  Therefore, only two wires should be connected, being ground and
                             servo pin.
                             “  I have used the TV output because it has a series resistor for
                             protection and ground outputs. I have connected an RCA plug to a
                             servo type cable & plug from an old PC and a 3pin stake block. You
                             could also put a series resistor in the RCA plug for protection if
                             you wish.”

                             “  Here is the connection diagram...
                                 NOTE: Deleted from this copy, see original if needed”
                             ‘─────────────────────────────────────────────────’
                             ‘  Uses the PropPlug and PSerialT to set the motor speed from the
                             PC Keyboard
                             ‘    0=OFF, 1=12.5%, 2=25%, 3=37.5%, 4=50%, 5=62.5%, 6=75%,
                             7=87.5%, 8=ON
                             ‘─────────────────────────────────────────────────
                             “ RR20100426   _rr001  use 20ms and 1ms...2ms (motor 1ms=off,
                             1.5ms=50%, 2ms=100%)”
                             “ uses fdx and PSerialT: 0=OFF, 1=12.5%, 2=25%, 3=37.5%, 4=50%,
                             5=62.5%, 6=75%,7=87.5%, 8=ON”

                             CON
                               _xinfreq  = 5_000_000
                               _clkmode  = xtal1+pll16x    ‘The system clock is set at 80MHz
                                                              (rec’d for optimal res)
                               Servo_Pin = 14              ‘ use the TV pin (My note: servo
                                                               pin 14)
                               rxPin  = 31                 ‘ serial
                               txPin  = 30
                               baud   = 115200
                               tvPin  = 14                 ‘TV pin (1-pin version)
                               kdPin  = 26                 ‘Kbd pin (1-pin version)

                             OBJ
                               fdx   :     “FullDuplexSerial”    ‘serial driver

                             VAR
                               long  position     ‘The assembly program will read this variable
                                                     from the main Hub RAM to determine the servo
                                                     signal’s high pulse duration

                             PUB Demo  | ch
   134   135   136   137   138   139   140   141   142   143   144