Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Dexter rocks!

JamesNewton

💭
Dexter rocks!
View GitHub Profile
View PROGMEM.md

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
@shirish47
shirish47 / ESP8266 Sleep Test code
Last active Sep 16, 2016
ESP8266 Sleep function testing for checking power consumption
View ESP8266 Sleep Test code
/*Author:??
found at ESP8266/arduino
*/
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
const char* ssid = "UNICORN";
const char* password = "Un1c()rn";
@chaeplin
chaeplin / esp8266_fpm_mdem_sleep.ino
Created Jan 26, 2016
esp8266_fpm_mdem_sleep.ino
View 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
@peterdikant
peterdikant / midi-footswitch.ino
Last active Feb 7, 2016
Arduino Footswitch to MIDI controller
View midi-footswitch.ino
// 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;
@ttilley
ttilley / kr-errata-2nd-edition.txt
Created Aug 20, 2011
Errata for The C Programming Language, Second Edition
View kr-errata-2nd-edition.txt
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.
You can’t perform that action at this time.