Skip to content

Instantly share code, notes, and snippets.

@Koepel
Koepel / averageRead.ino
Created Jan 12, 2020
This is how I use the average
View averageRead.ino
// ---------------------------------------------
// averageRead.ino
// ---------------------------------------------
// License: The Unlicense, Public Domain.
// Author: Koepel
//
// Version 1, 2020 jan 12
// First version of how I use the average.
// I'm not sure if this is the final version.
// ---------------------------------------------
View README.md
@Koepel
Koepel / Goldbach.ino
Created Mar 18, 2018
Arduino sketch for Goldbach's conjecture.
View Goldbach.ino
// Arduino IDE 1.8.5, Arduino Uno.
// 2018
// Warning: Just a test, it is still full of bugs.
//
// No use of tables, everything is calculated again for every number.
unsigned long number = 4; // start with 4, it must be even and greater than 2
void setup()
{
@Koepel
Koepel / Progmem_far.ino
Last active Mar 18, 2021
Test PROGMEM beyond 64k
View Progmem_far.ino
// Test PROGMEM beyond 64k
//
// This test is with Arduino IDE 1.8.5 and a Arduino Mega 2560.
//
// 29 december 2017
//
// For: http://forum.arduino.cc/index.php?topic=519175
//
// 2019: See https://forum.arduino.cc/index.php?topic=622922.0
// for multiple PROGMEM segments.
@Koepel
Koepel / FreezingSketch.ino
Last active Dec 21, 2017
Arduino sketch to test the Arduino board with freezing temperatures.
View FreezingSketch.ino
// Freezing Sketch
// ---------------
//
// December 2017
// Initial version.
// Using Arduino IDE 1.8.5
// For an Arduino Uno, Nano, Pro Mini.
// Not fully tested, but I did test it with freezing temperatures.
//
//
@Koepel
Koepel / HighWaterMark.ino
Created Dec 29, 2016
Arduino sketch to find the memory that was never used (HighWaterMark of the Stack) for a AVR microcontroller.
View HighWaterMark.ino
// -----------------------------------------
// HighWaterMark of the stack
// -----------------------------------------
// Calculate the high water mark for a Arduino with AVR microcontroller.
// It is the amount of memory that was never used since the Arduino was started.
//
// The __init() or .init1 up to .init9 was used in the past.
// It was used to run assembly code to fill the unused ram with a pattern.
// With Arduino 1.8.0 that did no longer work.
//
@Koepel
Koepel / Wasted.ino
Created Nov 16, 2016
Arduino sketch to calculate how much time is wasted in delays.
View Wasted.ino
// Wasted
// ------
// Show the percentage of cpu time that is wasted in delay().
// ----------------------------------------------------------
//
// 8 nov 2016, by Koepel.
// first version. Public Domain.
//
// 16 nov 2016, by Koepel
// Added more comment. Added fixed delay inside yield().
@Koepel
Koepel / BH1750.ino
Created Aug 17, 2016
BH1750 Arduino sketch to compare different modes
View BH1750.ino
// BH1750.ino
// ----------
// 17 august 2016
// First version by Koepel. Public Domain.
// Tested with Arduino Uno and Arduino.cc IDE 1.6.9
// In 2016, there are about 10 to 20 libraries for the BH1750,
// but I was not happy with the existing code.
// I started from scratch and tried to get the maximum out of the sensor.
//
//