Skip to content

Instantly share code, notes, and snippets.

avr-objcopy -O ihex -R .eeprom blink blink.hex
CC = avr-gcc
PROCESSOR = atmega328p
FREQ = 16000000
AVRDUDE_CONFIG = arduino
AVRDUDE_PART = ATMEGA328P
AVRDUDE_PROGRAMMING_DEVICE = /dev/tty.usbmodem1421
AVRDUDE_BAUD = 115200
all: buildhex
avrdude -F -V -c ATMEGA328P -p arduino -P /dev/tty.usbmodem1421 -b 115200 -U flash:w:blink:e
# note: most guides will tell you to do the below, but it's not necessary
# avrdude -F -V -c ATMEGA328P -p arduino -P /dev/tty.usbmodem1421 -b 115200 -U flash:w:blink.hex
@smcl
smcl / morse-ape-scream.ino
Created November 13, 2015 20:06
making a monkey keychain scream a morse code message, while displaying on a little 128x64 OLED screen
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_MOSI 9
#define OLED_CLK 10
#define OLED_DC 11
#define OLED_CS 12
#define OLED_RESET 13
$ avr-objdump -h blink
blink: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 000000b0 00000124 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 000000b0 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
$ cat Makefile
CC = avr-gcc
PROCESSOR = atmega328p
FREQ = 16000000
AVRDUDE_CONFIG = arduino
AVRDUDE_PART = ATMEGA328P
AVRDUDE_PROGRAMMING_DEVICE = /dev/tty.usbmodem1411
all: build
int boxSize = 50;
boolean bitmap[][] = new boolean[3][8];
void setup() {
size(150, 400);
background(225, 219, 203);
// horizontal lines
for (int i=1; i<3; i++) {
line(i * boxSize, 0, i * boxSize, height);
#ifndef ARDUINO_ARCH_SAM
#include <avr/io.h>
#endif
#include <avr/pgmspace.h>
#ifndef FONT5X7_H
#define FONT5X7_H
// standard ascii 5x7 font