From 8567adaa8141b99c086151de208d603cb51bc3ef Mon Sep 17 00:00:00 2001 From: shrkey Date: Sat, 24 Sep 2016 22:42:21 +0100 Subject: [PATCH] motor driving --- 640.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/640.md b/640.md index d215d50..5682381 100644 --- a/640.md +++ b/640.md @@ -73,8 +73,24 @@ from darkwater_640.darkwater_640 import dw_Controller, dw_Motor, dw_Servo #### Create a controller +The **dw_controller** object controls access to all the elements on the 640 board, so the first thing we need to do is create a controller - we pass in the address of the 640 board as a parameter - the default address is 0x60 + +``` python +dw = dw_Controller( addr=0x60 ) +``` + +Now that we have the controller created, we can access all the connectors on the board. + #### Select a Motor +There are 6 motor ports on the 640 board numbered 1 to 6 from left to right (with the ports facing you ). + +If we want to control a motor on port number 1 then we need to request the motor object for that port from our controller - this is very easily done with a single line + +``` python +m1 = dw.getMotor(1) +``` + #### Motor driving #### Select a Servo