Skip to content

Instantly share code, notes, and snippets.

View uXeBoy's full-sized avatar

Dan O'Shea uXeBoy

  • Adelaide, South Australia
View GitHub Profile
@uXeBoy
uXeBoy / conf_FPGA.sh
Created April 13, 2018 08:22 — forked from j-marjanovic/conf_FPGA.sh
iCE40 SPI Configuration
#!/bin/bash
# A script to configure Lattice iCE40 FPGA by SPI from Raspberry Pi
#
# Copyright (C) 2015 Jan Marjanovic <jan@marjanovic.pro>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#include "PS3USB.h"
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <SPI.h>
#endif
USB Usb;
PS3USB PS3(&Usb);
@uXeBoy
uXeBoy / Arduboy2Core.cpp
Last active May 9, 2018 06:48
Arduboy2Core.cpp
/**
* @file Arduboy2Core.cpp
* \brief
* The Arduboy2Core class for Arduboy hardware initilization and control.
*/
#include "Arduboy2Core.h"
const uint8_t PROGMEM lcdBootProgram[] = {
// boot defaults are commented out but left here in case they
@uXeBoy
uXeBoy / Arduboy2.cpp
Created May 3, 2018 22:45
Arduboy2.cpp
/**
* @file Arduboy2.cpp
* \brief
* The Arduboy2Base and Arduboy2 classes and support objects and definitions.
*/
#include "Arduboy2.h"
#include "ab_logo.c"
#include "glcdfont.c"
@uXeBoy
uXeBoy / JoyStick.ino
Last active May 9, 2018 08:30
JoyStick.ino
/* Read Joystick
* ------------
*
* Reads two analog pins that are supposed to be
* connected to a joystick made of two potentiometers
*
* http://www.0j0.org | http://arduino.berlios.de
* copyleft 2005 DojoDave for DojoCorp
*/
@uXeBoy
uXeBoy / test-toy.hex
Last active June 3, 2018 12:32
test-toy.hex
:100000000C94E8050C9410060C9410060C94100641
:100010000C9410060C9410060C9410060C94100608
:100020000C9410060C9410060C94510F0C941309A8
:100030000C9410060C9410060C9410060C941006E8
:100040000C9410060C9410060C9410060C941006D8
:100050000C9410060C9410060C9410060C94940B3F
:100060000C9410060C9410060C9410060C941006B8
:100070000C9410060C9410060C9410060C941006A8
:100080000C9410060C9410060C9410060C94100698
:100090000C9410060C9410060C9410060C94100688
@uXeBoy
uXeBoy / Bit5x5.h
Last active July 12, 2018 13:41
Bit5x5.h
//
// Font data for Bit5x5
// based on http://www.mattlag.com/bitfonts/bit5x5.ttf
//
#include <avr/io.h>
#include <avr/pgmspace.h>
// Character bitmaps for Bit5x5
static const unsigned char font[] PROGMEM =
@uXeBoy
uXeBoy / Sine.ino
Created July 17, 2018 01:30
Sine.ino
#include <Wire.h>
#include "Arduboy2.h"
uint8_t AcXH, AcXL;
constexpr float Tau = 6.28318530718;
constexpr float mapRange(float input, float inputMin, float inputMax, float outputMin, float outputMax)
{
return outputMin + (input - inputMin) * ((outputMax - outputMin) / (inputMax - inputMin));
@uXeBoy
uXeBoy / Game.cpp
Last active September 13, 2018 12:36
Game.cpp
/*
Copyright (C) 2018 Pharap (@Pharap)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@uXeBoy
uXeBoy / minimalDVID_encoder.v
Last active October 9, 2022 03:18
minimalDVID_encoder.v
`default_nettype none // disable implicit definitions by Verilog
//-----------------------------------------------------------------
// minimalDVID_encoder.vhd : A quick and dirty DVI-D implementation
//
// Author: Mike Field <hamster@snap.net.nz>
//
// DVI-D uses TMDS as the 'on the wire' protocol, where each 8-bit
// value is mapped to one or two 10-bit symbols, depending on how
// many 1s or 0s have been sent. This makes it a DC balanced protocol,
// as a correctly implemented stream will have (almost) an equal