Skip to content

Instantly share code, notes, and snippets.

View Robotonics's full-sized avatar
🏠
Working from home

David Cotterill-Drew Robotonics

🏠
Working from home
View GitHub Profile
@Robotonics
Robotonics / makeblock_bluetooth.py
Created December 6, 2016 18:13
Python program to communicate through Bluetooth to Orion controller with sunfounder BLE. controls direction and robot arm/grip.
from Tkinter import *
import Tkinter as tk
from PIL import Image, ImageTk
import os
root = tk.Tk()
frame = Frame(root,width=300,height=800)
frame.grid(row=0, column=0, padx=5, pady=5)
framespeed = Frame(root,width=300,height=800)
framespeed.grid(row=2, column=0, padx=5, pady=5)
framearm = Frame(root,width=300,height=800)
@Robotonics
Robotonics / MatrixGraphics.h
Created October 20, 2016 22:59
Header file containing arrays for 16x8 pixel graphics used in ir_robot.ino
uint8_t Bitmap_EyesFR[16]=
{
0x00,0x3c,0x42,0x5a,0x5a,0x42,0x3c,0x00,0x00,0x3c,0x42,0x5a,0x5a,0x42,0x3c,0x00
};
//int move_times = sizeof(string_data)*6;
uint8_t Bitmap_EyesTR[16]=
{
0x00,0x3c,0x42,0x42,0x72,0x72,0x3c,0x00,0x00,0x3c,0x42,0x42,0x72,0x72,0x3c,0x00
};
uint8_t Bitmap_EyesBlink[16]=
@Robotonics
Robotonics / ir_robot.ino
Created October 20, 2016 22:55
Robot with MLedMatrix panel, 4x servo's, Arduino Uno, and Adafruit 16bit PWM Driver
#include "Wire.h"
#include "MeOrion.h"
#include "Adafruit_PWMServoDriver.h"
#include "IRremote.h"
#include "MatrixGraphics.h"
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
MeLEDMatrix ledMx(PORT_1);
int IR_PIN = 8;
int b=random(300,10000);
#include "MeOrion.h"
MeLEDMatrix ledMx(PORT_1);
uint8_t Bitmap_EyesFR[16]=
{
0x00,0x3c,0x42,0x5a,0x5a,0x42,0x3c,0x00,0x00,0x3c,0x42,0x5a,0x5a,0x42,0x3c,0x00
};
//int move_times = sizeof(string_data)*6;
uint8_t Bitmap_EyesTR[16]=
@Robotonics
Robotonics / LinkNode_IO_DHT22.ino
Created October 3, 2016 23:14
Upload DHT22 data to LinkSprite IO
#include <ESP8266WiFi.h>
#include <WString.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include "DHT.h"
#define DHTPIN D3 // what pin we're connected to
import wx
import RPi.GPIO as GPIO
# Initialise GPIO's for Rover
GPIO.setwarnings(False)
PINS=[18,23,24,25]
GPIO.setmode(GPIO.BCM)
GPIO.setup(PINS,GPIO.OUT)
@Robotonics
Robotonics / sample code to test sensor
Created January 6, 2014 13:12
TCN75 Temp Sensor-Arduino
#include?"Wire.h"
#define?tcn75address?0x4F?// with pins 5~7 set to GND, the device address is 0x48
void setup()
{
??Wire.begin(); // wake up I2C bus
??Serial.begin(115200);
}
float tcn75_getTemperature(int address)
@Robotonics
Robotonics / openni_record_player.launch
Created June 22, 2016 15:19 — forked from bhaskara/openni_record_player.launch
Example ROS launch file that uses depth_image_proc to convert an RGB-depth image pair into a point cloud
<launch>
<!--
To distinguish between the cases where the rgb image is
1280x1024 versus 640x480. This affects the pipeline.
-->
<arg name="high_res_rgb" default="true"/>
<arg name="cloud_input_ns" value="camera/rgb_downsampled"
if="$(arg high_res_rgb)"/>
<arg name="cloud_input_ns" value="camera/rgb" unless="$(arg high_res_rgb)"/>
@Robotonics
Robotonics / gist:4e632eb7e07496786bcba6cfe5bb3d2e
Created April 27, 2016 22:53
servo_basic for photon robot
Servo Servo1;
Servo Servo2;
Servo Servo3;
Servo Servo4;
void setup() {
Servo1.attach(D0);
Servo2.attach(D1);
Servo3.attach(D2);
@Robotonics
Robotonics / fuel.ino
Created April 6, 2016 15:30
fuel.ino
// Project created by David Cotterill-Drew- Just to learn and have fun!
// 05/04/2016 23:08 GMT
#include "math.h" // needed for 'pow' and 'floor'
double fuelval; // Variable to hold voltage measurement
double fuelper; // Variable to hold battery charge as a percentage
int mic = A0; // Output of mic connected to A0 - ADC pin
int level=0; // Variavle to hold sound output measurement