Skip to content

Instantly share code, notes, and snippets.

View massimomusante's full-sized avatar
:octocat:

Massimo Musante massimomusante

:octocat:
View GitHub Profile
@massimomusante
massimomusante / PacDemo.ino
Created August 14, 2012 16:55
Pacman demo on arduino and hd44780 lcd display
/* LCD custom character demo */
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// make some custom characters:
byte pac1Def[8] = {
@massimomusante
massimomusante / PacDemo-1.ino
Created August 14, 2012 16:59
Pacman demo on arduino and hd44780 lcd display (fragments)
// make some custom characters:
...
byte pac2Def[8] = {
0b00000,
0b01110,
0b10100,
0b11000,
0b11100,
0b01110,
0b00000,
@massimomusante
massimomusante / exploring-sensors-1.java
Created November 12, 2012 12:57
Android sensor explorer (fragments)
public class SensorsActivity extends Activity implements SensorEventListener, OnItemSelectedListener
{
...
}
@massimomusante
massimomusante / test1.scad
Last active December 14, 2015 03:29
Some OpenSCAD examples
translate([-375,-375,-250])
{
cube([750,750,25]);
translate([0,0,525])
cube([750,750,25]);
translate([0,0,240])
cube([750,750,25]);
@massimomusante
massimomusante / DemoHello.java
Created April 25, 2013 14:04
Bouncing hello-world Slick2d demo
package com.musante.demo;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
/**
* Slick Hello-world demo
@massimomusante
massimomusante / DemoSprite.java
Created April 25, 2013 14:07
Bouncing ball Slick2D demo
package com.musante.demo;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
/**
@massimomusante
massimomusante / DemoHello1.java
Created April 25, 2013 14:18
Code fragments for Slick2d Blog post
...
g.drawString("Hello There!", 100, 100);
...
@massimomusante
massimomusante / DemoSprite1.java
Created April 25, 2013 14:23
More code fragments for Slick2d blog post
...
private int x = 100;
private int y = 100;
private int dx = 1;
private int dy = 1;
private Image img = null;
...
@massimomusante
massimomusante / AndEngineActivity.java
Created December 4, 2013 07:37
My first Andengine activity
package com.musante.demo.demoandengine;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.Background;
import org.andengine.entity.util.FPSLogger;
import org.andengine.ui.activity.SimpleBaseGameActivity;
@massimomusante
massimomusante / fragment-01-db-initialization.java
Last active August 29, 2015 14:04
Fragments from Neo4j demo
protected final static String DBPATH = "./localdb";
protected GraphDatabaseService db = null;
protected void startup()
{
// instantiate the database
db = new GraphDatabaseFactory().newEmbeddedDatabase(DBPATH);