From 9538d8bc99f71b48f63a7c6bb888c8fb65cb0821 Mon Sep 17 00:00:00 2001 From: shrkey Date: Tue, 16 Feb 2016 14:31:41 +0000 Subject: [PATCH] Initial Home page --- Mk1-code-example.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Mk1-code-example.md diff --git a/Mk1-code-example.md b/Mk1-code-example.md new file mode 100644 index 0000000..879fb64 --- /dev/null +++ b/Mk1-code-example.md @@ -0,0 +1,16 @@ +To best describe usage of the 640 Mk1 board, I'll paste the test script I put together and go through each section (Mk2 will be different to this, slightly). + +The first thing to do is to grab the 640Mk1 repository (or the https://github.com/adafruit/Adafruit-Motor-HAT-Python-Library) - the code in the main class isn't complete yet (or tested / debugged) but we're primarily after the Adafruit I2C and PWM modules for this example. + +Put the files **Adafruit_I2C.py** and **Adafruit_PWM_Servo_Driver.py** in your project directory (or path), then create a new file and populate it with the following: + + import RPi.GPIO as GPIO + import time + from Adafruit_PWM_Servo_Driver import PWM + +Grab the required modules + + pwm = PWM( 0x60, debug=False) + pwm.setPWMFreq(1600) + +Set up the PWM address and frequency