Skip to content

Instantly share code, notes, and snippets.

@dwhacks
dwhacks / Attiny85_blinkstrip_batteryMonitor.ino
Last active December 4, 2020 04:55
Attiny 85 blinking RGB LED strip + battery monitor
/*
Attiny85_batteryMonitor
Ideas borrowed from: https://github.com/unixbigot/Flat-Mate
modified for arduino tiny core by DWhacks
Added control of RGB LED strip or possibly just an RGB LED for use as a rear Bicycle light
*@@ Voltage trigger levels.
*
@dwhacks
dwhacks / Test_LPF.ino
Created April 19, 2020 03:09
Test_LPF.ino
//BCD to Decimal Test sketch by VE7DNT
const int A = 4; //pin numbers
const int B = 5;
const int C = 6;
const int D = 7;
void setup() {
// put your setup code here, to run once:
@dwhacks
dwhacks / Test_LPF.ino
Created April 19, 2020 03:08
Test_LPF.ino
//BCD to Decimal Test sketch by VE7DNT
const int A = 4; //pin numbers
const int B = 5;
const int C = 6;
const int D = 7;
void setup() {
// put your setup code here, to run once:
sudo su
sudo echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
@dwhacks
dwhacks / speed.txt
Created January 27, 2014 07:07
speed equation tetris
For speed I used the formula:
delay = 725 * .85 ^ level + level
Where delay is the time (in milliseconds) before the block falls one row -- That equation reaches its minimum at level 30 (35.5 ms delay) and begins to climb again until delay = level (basicly the game slows down about 6ms per drop by level 41). However, I was modeling a certain behavior, and you might have better performance with a more general equation:
delay = delay_at_level_0 / (level + 1)
Where delay_at_level_0 is a constant
/**********************************************
* Catalin Batrinu bcatalin@gmail.com
* Read temperature and pressure from BMP280
* and send it to thingspeaks.com
**********************************************/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php if(!session_id()) session_start(); ?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>GPS Tracker</title>
</head>
<body>
@dwhacks
dwhacks / tetris_speed_tester.ino
Last active January 4, 2016 17:59
Tetris drop speed versus level calculator test platform TO THE XTREME By D-Whacks2000
/*Tetris drop speed versus level calculator test platform TO THE XTREME
By D-Whacks2000
*/
int level = 0;
int dropSpeed = 1000;
@dwhacks
dwhacks / BlocDrop_v01.ino
Last active January 4, 2016 12:09
Progress on gamby blocdrop
/*
BLOC DROP: A strangely familiar falling block game
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
by David Randall Stokes (gamby@logicalzero.com) 9/05/2012
THIS IS STILL A WORK-IN-PROGRESS. The game is playable, but
the scoring doesn't work correctly.
*/
@dwhacks
dwhacks / BlocDrop.ino
Created January 25, 2014 00:50
fixedblocdrop
/*
BLOC DROP: A strangely familiar falling block game
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
by David Randall Stokes (gamby@logicalzero.com) 9/05/2012
THIS IS STILL A WORK-IN-PROGRESS. The game is playable, but
the scoring doesn't work correctly.
*/