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 / MegaBot.h
Created January 4, 2014 19:16
Header for MegaBot library
// Arduino library to control Megabot Drive
// David Cotterill-Drew @2013 RoboTonics
#ifndef MegaBot_h
#define MegaBot_h
#include <Arduino.h>
class MegaBot
{
@Robotonics
Robotonics / MegaBot.cpp
Created January 4, 2014 19:18
Megabot C++ file for MegaBot library
// Megabot control library
// David Cotterill-Drew @2013 RoboTonics
#include <Arduino.h>
#include <MegaBot.h>
MegaBot::MegaBot(int R0, int R1, int L0, int L1, int EN0, int EN1)
{
int _R0=R0;
byte highByte;
byte lowByte;
?
Wire.beginTransmission(address); //starts communication with cmps03
Wire.write(2); //Sends the register we wish to read
Wire.endTransmission();
?
Wire.requestFrom(address, 2); //requests high byte
while(Wire.available() < 2); //while there is a byte to receive
highByte = Wire.read(); //reads the byte as an integer
@Robotonics
Robotonics / BTtest.ino
Last active February 19, 2016 07:26
Bluetooth serial test for Arduino Bluetooth shield from Maplin
#include <SoftwareSerial.h>
#define RxD 7
#define TxD 6
SoftwareSerial BlueToothSerial(RxD,TxD);
char flag=1;
void Test_BlueTooth()
{
unsigned char t=0;
@Robotonics
Robotonics / fuelgague.ino
Created April 5, 2016 23:04
Creates two Particle cloud variables, one ( fuelval ) for battery voltage, and the other ( fuelper ) for battery percentage remaining.
// Project created by David Cotterill-Drew- Just to learn and have fun!
// 05/04/2016 23:08 GMT
#include "application.h"
double fuelval;
double fuelper;
FuelGauge fuel;
void setup()
{
@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
@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 / 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 / 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)
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)