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
#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 / 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 / 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 / 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 / NESRAM.sch
Created December 27, 2018 03:19
NESRAM.sch
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="8.2.2">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="inch" altunit="inch"/>
<layers>
@uXeBoy
uXeBoy / BeepTest.ino
Created July 10, 2019 04:35
BeepTest.ino
#include <Arduboy2.h>
Arduboy2 arduboy;
BeepPin1 beep1;
BeepPin2 beep2;
static bool tonesPlaying = false;
static uint8_t duration = 0;
static uint8_t *tonesStart = 0;