This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avr-objcopy -O ihex -R .eeprom blink blink.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = avr-gcc | |
PROCESSOR = atmega328p | |
FREQ = 16000000 | |
AVRDUDE_CONFIG = arduino | |
AVRDUDE_PART = ATMEGA328P | |
AVRDUDE_PROGRAMMING_DEVICE = /dev/tty.usbmodem1421 | |
AVRDUDE_BAUD = 115200 | |
all: buildhex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat Makefile | |
CC = avr-gcc | |
PROCESSOR = atmega328p | |
FREQ = 16000000 | |
AVRDUDE_CONFIG = arduino | |
AVRDUDE_PART = ATMEGA328P | |
AVRDUDE_PROGRAMMING_DEVICE = /dev/tty.usbmodem1411 | |
all: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ARDUINO_ARCH_SAM | |
#include <avr/io.h> | |
#endif | |
#include <avr/pgmspace.h> | |
#ifndef FONT5X7_H | |
#define FONT5X7_H | |
// standard ascii 5x7 font |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 | |
2 .comment 00000011 00000000 00000000 00000124 2**0 | |
CONTENTS, READONLY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ avr-objdump -h blink | |
blink: file format elf32-avr | |
Sections: | |
Idx Name Size VMA LMA File off Algn | |
0 .data 00000004 00800100 000000c6 0000015a 2**0 | |
CONTENTS, ALLOC, LOAD, DATA | |
1 .text 000000c6 00000000 00000000 00000094 2**1 | |
CONTENTS, ALLOC, LOAD, READONLY, CODE | |
2 .eeprom 00000002 00810000 00810000 0000015e 2**0 | |
CONTENTS, ALLOC, LOAD, DATA |