This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tkinter and GPIO together Matt Richardson, modified by S&S 2-Apr-15 | |
from Tkinter import * | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(23, GPIO.OUT) | |
GPIO.setup(24, GPIO.OUT) | |
GPIO.setup(25, GPIO.OUT) | |
GPIO.output(23, GPIO.LOW) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if(sys.version_info[0]<3): | |
from Tkinter import * | |
else: | |
from tkinter import * | |
import RPi.GPIO as pi | |
import math | |
#import tkSimpleDialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# This version uses the Complementary Filter output to drive the 2 servos | |
import smbus | |
import math | |
import time | |
from Adafruit_PWM_Servo_Driver import PWM | |
# Initialise the PWM device using the default address | |
pwm = PWM(0x40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# KC6050Servos.py Reads MPU6050 and also drives 2 servos | |
# Initially written by Adafruit and developed by S&S Dec 2014 | |
import smbus | |
import math | |
import time | |
from Adafruit_PWM_Servo_Driver import PWM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# KC6050Servos.py Reads MPU6050 and also drives 2 servos | |
# Initially written by Adafruit and developed by S&S Dec 2014 | |
import smbus | |
import math | |
import time | |
from Adafruit_PWM_Servo_Driver import PWM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# KC6050Servos.py Reads MPU6050 and also drives 2 servos | |
# Initially written by Andrew Birkett and Adafruit and developed by S&S Dec 2014 | |
import smbus | |
import math | |
import time | |
from Adafruit_PWM_Servo_Driver import PWM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# KC6050Servos.py Reads MPU6050 and also drives 2 servos | |
import smbus | |
import math | |
from Adafruit_PWM_Servo_Driver import PWM | |
# Initialise the PWM device using the default address | |
pwm = PWM(0x40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import smbus | |
import math | |
# Power management registers | |
power_mgmt_1 = 0x6b | |
power_mgmt_2 = 0x6c | |
def read_byte(adr): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#This python program serves a web page which can be accessed via | |
#local wifi network, giving x and y rotations of the MPU-6050 | |
# Written by Andrew Birkett | |
# (http://blog.bitify.co.uk/2013/11/3d-opengl-visualisation-of-data-from.html) | |
# and modified by S&S Dec 2014 | |
import web | |
import smbus | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# script by Sparks N Smoke for SOFTWARE control of LEDs with Pulse Width Modulation | |
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(24, GPIO.OUT) # LED Red PWM port - can use any GPIO port ! | |
GPIO.setup(25, GPIO.OUT) # LED Green PWM port | |
GPIO.setup(26, GPIO.OUT) # LED Blue PWM port |