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 / menu_selector.xml
Created May 18, 2013 23:22
Background selector for menu button
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/menu_hover"
/>
@Robotonics
Robotonics / menu_hover.xml
Created May 18, 2013 23:23
Hover background for menu button
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" shape="rectangle">
<gradient android:angle="270"
android:startColor="#6b6b6b"
android:endColor="#0e0e0e"
/>
<Button
android:id="@+id/Pause"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:background="@drawable/menu_selector"
android:text="@string/Pause"/>
@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;