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 / Arduino.c
Created May 18, 2023 13:08
Example of bit banging on CH32V
/*
* Arduino.c
*
* Created on: Jan 12, 2023
* Author: larry
*/
#include "debug.h"
#include <stdint.h>
#include "Arduino.h"
@bitbank2
bitbank2 / interactive_spi.ino
Created March 25, 2023 08:18
An interactive serial terminal program to control GPIO, SPI, etc on a USB-connected Microcontroller
//
// Interactive SPI & GPIO tester
// written by Larry Bank
// August 14, 2022
//
// Purpose: Use the serial terminal to interactively test SPI & GPIO devices on ESP32 MCUs
//
// Copyright 2022 BitBank Software, Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@bitbank2
bitbank2 / person_sensor.h
Created November 10, 2022 12:53
Person Sensor test sketch for Arduino (FeatherS3 w/OLED display)
#ifndef INCLUDE_PERSON_SENSOR_H
#define INCLUDE_PERSON_SENSOR_H
// Definitions for the Useful Sensors Person Sensor module.
// Includes the standard I2C address of the sensor, constants for the
// configuration commands, and the data structures used to communicate results
// to the main system.
// See the full developer guide at https://usfl.ink/ps_dev for more information.
#include <stdint.h>
@bitbank2
bitbank2 / gps_test.ino
Created August 20, 2022 13:39
Simplest possible program to capture GPS current time and location (no external dependencies for parsing NMEA strings)
//
// GP-02 GPS/BDS/GNSS module performance test
// tested with a ESP32-S2 module (USB CDC serial + exposed HW UART pins)
//
#include <OneBitDisplay.h>
ONE_BIT_DISPLAY obd;
uint8_t u8Flags;
#define FLAG_TIMEDATE 1
#define FLAG_POSITION 2
@bitbank2
bitbank2 / Roboto_Black_20.h
Created August 18, 2022 11:18
ESP32-S2 (FeatherS2) e-ink weather station
// Created by http://oleddisplay.squix.ch/ Consider a donation
// In case of problems make sure that you are using the font file with the correct version!
const uint8_t Roboto_Black_20Bitmaps[] PROGMEM = {
// Bitmap Data:
0x00, // ' '
0xF7,0xBD,0xEF,0x39,0xCC,0x63,0x00,0xCF,0x30, // '!'
0xCD,0x9B,0x36,0x6C,0xD9,0x00, // '"'
0x0C,0xC0,0xCC,0x0D,0x80,0xD8,0x7F,0xE7,0xFE,0x19,0x81,0x90,0xFF,0xEF,0xFE,0x13,0x03,0x30,0x33,0x03,0x70, // '#'
0x04,0x00,0x80,0x7C,0x3F,0xC7,0xFC,0xE7,0x9C,0x03,0xE0,0x3F,0x03,0xF0,0x0F,0x70,0xEF,0x3D,0xFF,0x9F,0xE0,0xF8,0x0C,0x01,0x80, // '$'
// Created by http://oleddisplay.squix.ch/ Consider a donation
// In case of problems make sure that you are using the font file with the correct version!
const uint8_t Roboto_Black_28Bitmaps[] PROGMEM = {
// Bitmap Data:
0x00, // ' '
0xFB,0xEF,0x3C,0xF3,0xCF,0x3C,0xF3,0xCF,0x3C,0xF0,0x00,0x3C,0xF3,0xEF,0x3C, // '!'
0xF7,0x7B,0xB9,0xDC,0xEE,0x77,0x3B,0x9D,0xCE, // '"'
0x03,0x18,0x03,0x9C,0x01,0xCE,0x00,0xE7,0x00,0x73,0x80,0x39,0x81,0xFF,0xFC,0xFF,0xFE,0x7F,0xFF,0x07,0x38,0x03,0x9C,0x01,0xCC,0x0F,0xFF,0xE7,0xFF,0xF3,0xFF,0xF8,0x39,0xC0,0x1C,0xE0,0x0E,0x70,0x06,0x30,0x07,0x38,0x00, // '#'
0x03,0x80,0x07,0x00,0x0E,0x00,0x7E,0x01,0xFF,0x07,0xFF,0x1F,0xFE,0x3E,0x3E,0x78,0x7C,0xF8,0x01,0xF8,0x01,0xFC,0x01,0xFE,0x01,0xFE,0x00,0xFE,0x00,0x7E,0xF8,0x7D,0xF0,0xFB,0xF1,0xF3,0xFF,0xE7,0xFF,0x87,0xFE,0x03,0xF8,0x01,0x80,0x03,0x00,0x06,0x00, // '$'
@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
@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 / 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 / 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>