Skip to content

Instantly share code, notes, and snippets.

@kcranley1
kcranley1 / drive_in_square.py
Last active August 29, 2015 13:57
My own version of drive_in_square.py
#! /usr/bin/env python
# drive_in_square.py
import time
import pibot
import sys
bot = pibot.PiBot()
# speed = 255
speed = 64
@kcranley1
kcranley1 / monitor_ultrasonic.py
Last active August 29, 2015 13:57
My version of monitor_ultrasonic.py
#! /usr/bin/env python
# monitor_ultrasonic.py
import time
import pibot
bot = pibot.PiBot()
while True:
@kcranley1
kcranley1 / robot_teleop.py
Last active August 29, 2015 13:57
My version of robot_teleop.py
#! /usr/bin/python
# robot_teleop.py
import pibot
import time
TURN_TIME = 0.2
bot = pibot.PiBot()
@kcranley1
kcranley1 / KCtest2.py
Last active August 29, 2015 13:57
My version of test_pibot_hardware.py - uses picamera to record video!
#! /usr/bin/env python
# test_pibot_hardware.py
import time
import os.path
import sys
import pygame
import pygame.mixer
@kcranley1
kcranley1 / PiBot_Firmware_Alpha
Last active October 4, 2016 17:50
My (working) version of James Torbett's early alpha release.
//
// PiBot arduino code - PiBot_Firmware_Alpha
// James Torbett 2014
// v. 0.1
// EARLY ALPHA RELEASE
//
// Todo:
// ADC implementation
// Temperature (thermistor)
// Voltages
@kcranley1
kcranley1 / KCtest1
Last active August 29, 2015 13:57
A version of test_pibot_hardware.py - under construction!. Hoping to develop it to use the ultrasonic distance detector to stay out of trouble!
#! /usr/bin/env python
# KCtest1.py
import time
import os.path
import sys
import pygame
import pygame.mixer
@kcranley1
kcranley1 / KCTest3.py
Last active August 29, 2015 13:57
This version uses picamera to record video!
#! /usr/bin/env python
# KCtest3.py - Records a video using picamera
import time
import os.path
import sys
import pygame
import pygame.mixer
@kcranley1
kcranley1 / KCtest4.py
Last active August 29, 2015 13:58
A further version to modify the routine to get out of trouble
#! /usr/bin/env python
# KCtest4.py - All references to picamera have been removed, to allow
# MJPG-Streamer to be used to transmit JPEG images over WiFi network
import time
import os.path
import sys
import pygame
@kcranley1
kcranley1 / MPU6050_DMP6KC
Last active March 19, 2023 16:19
My first working attempt to get this going with the GY521 - MPU-6050 Module 3 Axis Analog Gyro Sensor + Accelerometer Module for MPU 6050
// I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)
// 6/21/2012 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2013-05-08 - added seamless Fastwire support
// - added note about gyro calibration
// 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error
// 2012-06-20 - improved FIFO overflow handling and simplified read process
// 2012-06-19 - completely rearranged DMP initialization code and simplification
@kcranley1
kcranley1 / MPU6050TeapotDemoKC
Last active May 14, 2017 16:53
My first Processing script to run the MPU6050 3-axis Gyro & Accelerometer (needs Arduino sketch also)
// I2C device class (I2Cdev) demonstration Processing sketch for MPU6050 DMP output
// 6/20/2012 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2012-06-20 - initial release
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg