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 / android java animation
Created May 27, 2013 10:45
Sample animation using drawable resources
AnimationDrawable rocketAnimation;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image);
rocketImage.setBackgroundResource(R.drawable.rocket_thrust);
rocketAnimation = (AnimationDrawable) rocketImage.getBackground();
}
@Robotonics
Robotonics / Vertical-Navigation-Menu.markdown
Created September 6, 2013 16:08
A Pen by Madalin Tudose.
#include <Tone.h>
Tone freq1;
Tone freq2;
const int DTMF_freq1[] = { 1336, 1209, 1336, 1477, 1209, 1336, 1477, 1209, 1336, 1477 };
const int DTMF_freq2[] = { 941, 697, 697, 697, 770, 770, 770, 852, 852, 852 };
void setup()
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Totally "960 Colors"
Author : VenomVendor
Refer : http://stackoverflow.com/q/3769762/1008278
Reference : http://www.computerhope.com/htmcolor.htm , http://www.color-hex.com/color-names.html
-->
<!-- Colors arranged from A -Z -->
<color name="air_force_blue">#5D8AA8</color>
@Robotonics
Robotonics / JoystickView
Created December 30, 2013 13:38
Virtual Joystick- Android/Arduino via adb
package org.microbridge.servocontrol;
import java.io.IOException;
import org.microbridge.server.AbstractServerListener;
import org.microbridge.server.Server;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
@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;
@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)