Skip to content

Instantly share code, notes, and snippets.

View JamesNewton's full-sized avatar
💭
Dexter rocks!

JamesNewton

💭
Dexter rocks!
View GitHub Profile
@ttilley
ttilley / kr-errata-2nd-edition.txt
Created August 20, 2011 18:42
Errata for The C Programming Language, Second Edition
Errata for The C Programming Language, Second Edition
This lists all known errors in The C Programming Language, Second Edition, by Brian Kernighan and Dennis Ritchie (Prentice-Hall, 1988).
The pagination of the book has changed only in minor ways across printings of the English-language edition. These errata now include section numbers, which are more likely to be preserved across translations. This might help identify errors that survive into translated editions.
Changes between first and second printing:
The first printing of the book was made before the Standard was finalized; these copies say "Based on Draft-Proposed ANSI C" on the front cover. All subsequent printings are identified by a large red ``ANSI C'' on the right center of the cover. Fortunately, the changes are minor; some repair our bugs, a few account for last-minute changes in the draft standard. These changes were made so early that they probably do not apply to you.
@peterdikant
peterdikant / midi-footswitch.ino
Last active February 7, 2016 06:06
Arduino Footswitch to MIDI controller
// pin to use for indicator LED
int ledPin = 12;
// pin that is connected to the footswitch
int buttonPin = 2;
int buttonState = 0;
int buttonLastState = 0;
int buttonInitState = 0;
int muteStatus = 0;
@chaeplin
chaeplin / esp8266_fpm_mdem_sleep.ino
Created January 26, 2016 11:39
esp8266_fpm_mdem_sleep.ino
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "/usr/local/src/ap_setting.h"
extern "C" {
#include "user_interface.h"
}
#define FPM_SLEEP_MAX_TIME 0xFFFFFFF
@shirish47
shirish47 / ESP8266 Sleep Test code
Last active September 16, 2016 01:15
ESP8266 Sleep function testing for checking power consumption
/*Author:??
found at ESP8266/arduino
*/
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
const char* ssid = "UNICORN";
const char* password = "Un1c()rn";
@sticilface
sticilface / PROGMEM.md
Last active July 23, 2023 11:38
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR