Skip to content

Instantly share code, notes, and snippets.

@biomood
biomood / GameDuino_HelloWorld.c
Created June 16, 2011 20:30
Hello World for the Gameduino
#include <SPI.h>
#include <GD.h>
void setup() {
// give time for the gameduino splash screen to be displayed
delay(2500);
GD.begin();
// load character set
@biomood
biomood / dingoo_font.lua
Created June 10, 2011 19:04
Code for nLove that displays user-created fonts correctly
require "string"
---------------------------------------------------------
-- a font library for the dingoo --
-- allows for multiple fonts --
---------------------------------------------------------
-- creates a table of images from a font
-- ImageData source, String char_list, Number char_width, Number seperator_width
@biomood
biomood / RestSharpPOST.cs
Created June 2, 2011 13:56
POST to restful service using .Net and RestSharp
// create the client
RestClient client = new RestClient();
client.BaseUrl = url;
// create the request
RestRequest request = new RestRequest(Method.POST);
request.Resource = service_method;
request.AddParameter("text/xml", body, ParameterType.RequestBody);
// send the request
@biomood
biomood / MoveSprite.asm
Created May 31, 2011 20:49
A C64 example in assembly that moves a sprite up/down/left/right
;*************************************************
;* Create and move a simple sprite x,y *
;*************************************************
processor 6502
org $1000
;helpful labels
CLEAR = $E544
GETIN = $FFE4
@biomood
biomood / Love2D_KeyTest.lua
Created May 31, 2011 20:43
Love2D code for seeing what key/joystick button is pressed
game = {}
game.button= ""
game.key = ""
function love.load()
success = love.graphics.setMode(320, 240, false, 0)
end
function love.update(dt)
end
@biomood
biomood / C64ArrowCursor.asm
Created May 30, 2011 09:37
C64 - Move the cursor using the arrow keys
;*********************************************
;* Arrow Cursor, W,S,A,D *
;*********************************************
processor 6502
org $1000
;setup helpful labels
CLEAR = $E544
CHROUT = $FFD2
@biomood
biomood / HelloWorld_BYTE_CHROUT_LOOPS.asm
Created May 29, 2011 11:06
Hello World for the C64 using .BYTE, CHROUT and loops
;*********************************************************
;* HELLOWORLD using .BYTE, CHROUT and loops *
;*********************************************************
processor 6502
org $C000
;set up some helpful labels
CLEAR = $E544
CHROUT = $FFD2
@biomood
biomood / HelloWorld_ScreenMemory.asm
Created May 25, 2011 20:35
C64 Assembly Hello World (using screen memory)
;put Hello World using screen address
;rather than jsr $e716
processor 6502
org $1000
jsr $E544 ;clear the screen
;set the screen color memory
lda #0 ;black in A
@biomood
biomood / HelloWorld.asm
Created May 25, 2011 05:47
C64 Assembly Hello World (using jsr $E716)
processor 6502
org $1000
jsr $e544 ;clear the screen
lda #72 ;load ascii value for H into A
jsr $e716 ;display H from A to screen
lda #69 ;load E into A
jsr $e716 ;display E
@biomood
biomood / TempLogger.cpp
Created May 4, 2011 19:41
Arduino and Python Temperature Logger
#include <OneWire.h>
#include <DallasTemperature.h>
// pin setups
int latchPin = 8;
int clockPin = 12;
int dataPin = 11;
int tempPin = 7;
char recMsg = '0';