Skip to content

Instantly share code, notes, and snippets.

View bitbank2's full-sized avatar
💭
writing new Arduino libraries

Larry Bank bitbank2

💭
writing new Arduino libraries
View GitHub Profile
@bitbank2
bitbank2 / ArduinoMIDI2OPZ.ino
Created June 12, 2020 21:06
Arduino MIDI controller Demo
/* Arduino analog to BLE MIDI
Ubi de Feo @ Bar Arduino
https://www.youtube.com/watch?v=0zNmt_IKwRg
supported boards:
- Arduino MKR WiFi 1010
- Arduino Nano 33 IoT
- Arduino Nano 33 BLE
- Arduino Nano 33 BLE Sense
- Arduino UNO WiFI Rev. 2
**** Sketch for USB MIDI version (Nano 33 BLE not supported) ****
@bitbank2
bitbank2 / arduino_perf.ino
Created June 27, 2020 22:49
An example of why it's important to know your target machine when writing software
//
// Arduino Perf
//
// This sketch is to show how much time it takes for the CPU to work
// with different variable types. Knowing that you're running on an
// 8-bit CPU vs a 32-bit CPU can have a huge effect on the performance
// of your code and your design choices. The Cortex-M4F has a hardware
// floating point unit, so integer versus float doesn't make much difference.
// while the AVR has to calculate floating point values using software and
// is much slower at it than integer calculations. It's also clear that the
@bitbank2
bitbank2 / pyportal_demo.ino
Created August 24, 2020 22:41
A sketch to demonstrate using my GIF and JPEG libraries together on the Adafruit PyPortal to play either type of file found on the SD Card
// AnimatedGIF + JPEG SDCard example for Adafruit PyPortal
// using SdFat library for card reads and DMA for screen updates
#include <AnimatedGIF.h>
#include <JPEGDEC.h>
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <SdFat.h> // Instead of SD library
#include <Wire.h>
#include <bb_spi_lcd.h>
#define WIDTH 240
#define HEIGHT 135
#define TFT_CS 5
#define TFT_RST 18
#define TFT_DC 23
//
// Demo sketch to read the data from a RadioLand RDL52832 iBeacon
//
// Displays the data on an M5StickC-Plus without using the M5Stack library
// Also works on the Nano33 BLE
// Parses (in a brute-force way) the large advertisement packet transmitted
// by the iBeacon.
//
// Written by Larry Bank
@bitbank2
bitbank2 / color_coin_demo.ino
Created March 16, 2021 00:15
Demo sketch for Mike Rankin's ESP32 Color coincell PCB
#include <Adafruit_VL53L0X.h>
#include <bb_spi_lcd.h>
#include <WiFi.h>
#include <Wire.h>
#include <BitBang_I2C.h>
#include <BLEDevice.h>
#include <esp32_gamepad.h>
BLEScan *pBLEScan;
BLEScanResults foundDevices;
@bitbank2
bitbank2 / main.c
Last active April 28, 2021 06:07
C Optimization demo project
//
// main.c
// perf_demo
//
// Created by Laurence Bank on 3/24/21.
//
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@bitbank2
bitbank2 / README.txt
Last active October 15, 2021 09:56
Multi-Invaders emulator for Arduino
Multi-Invaders Game Emulator
Written by Larry Bank (bitbank@pobox.com)
Copyright (c) 2021 BitBank Software, Inc.
Project started July 2021
This Arduino sketch contains the code needed to emulate the original
Taito Space Invaders along with Galaxy Wars and Lunar Rescue. The project
does not contain any game code and instead will read the game code and data
from ZIP files provided by the user. The 3 ZIP files can be from MAME or
other emulators and must contain the following files:
@bitbank2
bitbank2 / gif_64x128_oled_example.ino
Created March 1, 2022 12:37
Example Arduino code to run smooth Animated GIF playback on a SH1107 OLED
//
// Animated GIF demo for SH1107 (64x128) OLED
//
// written by Larry Bank (bitbank@pobox.com)
// 2022-03-01
//
// This sketch provides example code of how to use my AnimatedGIF and OneBitDisplay
// libraries to display a smooth animation on the I2C SH1107 OLED display
// Normally these displays are driven at 100Khz or 400Khz clock speed, but they are
// capable of running reliably at up to 2Mhz since the same controller chip supports
@bitbank2
bitbank2 / scd41_01space.ino
Created May 12, 2022 16:47
SCD41 CO2 sensor demo running on 01Space's ESP32-C3 0.42" OLED board
//
// SCD4x example
// Customized for the 01Space ESP32-C3 0.42" OLED board
// written by Larry Bank
//
// Displays the SCD41 CO2 sensor values on the built-in 72x40 OLED
//
#include <Wire.h>
#include <OneBitDisplay.h>
#include "SparkFun_SCD4x_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_SCD4x