Skip to content

Instantly share code, notes, and snippets.

@biomood
biomood / Screen.c
Created March 18, 2012 17:30
Lua library for accessing the framebuffer of a chumby
/*
* A Lua library in C to display interface
* with the chumby frame buffer
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
int luaopen_screen(lua_State *L) {
luaL_newmetatable(L, SCREENMETA);
luaL_register(L, "screen", screenLib);
return 1;
}
@biomood
biomood / PerlinNoise.c
Created May 21, 2012 19:04
perlin noise in C, uses lodepng library
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include "lodepng.h"
#define WIDTH 400
#define HEIGHT 400
#define PI (3.141592653589793)
#include <IRremote.h>
#include "Timer.h"
#define CMD_CONST_COLOUR (1 << 4)
#define CMD_FLASH (1 << 5)
#define CMD_ALT (1 << 6)
#define CMD_OFF 0
#define COL_RED_K (1 << 4)
#define COL_GREEN_K (1 << 5)