Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐔➡️🚀

Stefan Kremser spacehuhn

💭
🐔➡️🚀
View GitHub Profile
@gojimmypi
gojimmypi / Install_ESP32.bat
Created Dec 21, 2017
M5stack ESP32 Arduino IDE install
View Install_ESP32.bat
:: Arduino IDE 1.8.5
:: see https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide#installing-the-esp32-arduino-core
:: run as administrator
cd "C:\Program Files (x86)\Arduino\hardware"
mkdir espressif
cd espressif
git clone https://github.com/espressif/arduino-esp32.git esp32
:: run get.exe
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
@heiswayi
heiswayi / repo-reset.md
Created Feb 5, 2017
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@MightyPork
MightyPork / usb_hid_keys.h
Last active May 13, 2021
USB HID Keyboard scan codes
View usb_hid_keys.h
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@SeeJayDee
SeeJayDee / tiny_IRremote.cpp
Last active Jan 2, 2021
tiny_IRremote - Arduino IRremote ported to the ATtiny
View tiny_IRremote.cpp
/*
* tiny_IRremote
* Version 0.2 July, 2016
* Christian D'Abrera
* Fixed what was originally rather broken code from http://www.gammon.com.au/Arduino/
* ...itself based on work by Ken Shirriff.
*
* This code was tested for both sending and receiving IR on an ATtiny85 DIP-8 chip.
* IMPORTANT: IRsend only works from PB4 ("pin 4" according to Arduino). You will need to
* determine which physical pin this corresponds to for your chip, and connect your transmitter
@gbaman
gbaman / HowToOTG.md
Last active May 9, 2021
Simple guide for setting up OTG modes on the Raspberry Pi Zero
View HowToOTG.md

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@zachflower
zachflower / rainbow.cpp
Last active May 7, 2021
Smooth RGB LED Color Transitions (Arduino)
View rainbow.cpp
int redPin = 11;
int greenPin = 10;
int bluePin = 9;
int r = 0;
int g = 0;
int b = 0;
void setup() {
pinMode(redPin, OUTPUT);
@k3rn31
k3rn31 / uncrustify.cfg
Last active Mar 2, 2021 — forked from mkroman/Network.cpp
Uncrustify config based on Google C++ Style Guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.html
View uncrustify.cfg
#
# Google C++ Style Guide (sorta)
#
indent_align_string=true
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false