20121012-183142

This commit is contained in:
BlubbFish 2012-10-12 16:28:45 +00:00
parent 9091b7250e
commit 1aeac2ce36
4 changed files with 20 additions and 7 deletions

View File

@ -1,11 +1,24 @@
#include <avr/io.h> #include <avr/io.h>
#include <util/delay.h> #include <util/delay.h>
#define S0 0b01111011
#define S1 0b00000011
#define S2 0b01101110
#define S3 0b01001111
#define S4 0b00010111
#define S5 0b01011101
#define S6 0b01111101
#define S7 0b00001011
#define S8 0b01111111
#define S9 0b01011111
#define SA 0b00111111
#define SB 0b01110101
#define SC 0b01111000
int main(void) { int main(void) {
DDRB = 0b01111111; DDRB = 0b01111111;
while(1){ while(1){
PORTB = 255; PORTB = SC;
_delay_ms(500); _delay_ms(500);
PORTB = 0; PORTB = 0;
_delay_ms(500); _delay_ms(500);

Binary file not shown.

View File

@ -1,7 +1,7 @@
:1000000012C017C016C015C014C013C012C011C052 :1000000012C017C016C015C014C013C012C011C052
:1000100010C00FC00EC00DC00CC00BC00AC009C07C :1000100010C00FC00EC00DC00CC00BC00AC009C07C
:1000200008C007C006C011241FBECFEDCDBF02D04F :1000200008C007C006C011241FBECFEDCDBF02D04F
:1000300019C0E6CF8FE787BB8FEF88BB2FEF34E384 :1000300019C0E6CF8FE787BB88E788BB2FEF34E393
:100040004CE0215030404040E1F700C0000018BAB9 :100040004CE0215030404040E1F700C0000018BAB9
:100050002FEF34E34CE0215030404040E1F700C046 :100050002FEF34E34CE0215030404040E1F700C046
:080060000000EBCFF894FFCF84 :080060000000EBCFF894FFCF84

View File

@ -61,17 +61,17 @@ Disassembly of section .text:
32: e6 cf rjmp .-52 ; 0x0 <__vectors> 32: e6 cf rjmp .-52 ; 0x0 <__vectors>
00000034 <main>: 00000034 <main>:
#include <avr/io.h> #define SA 0b00111111
#include <util/delay.h> #define SB 0b01110101
#define SC 0b01111000
int main(void) { int main(void) {
DDRB = 0b01111111; DDRB = 0b01111111;
34: 8f e7 ldi r24, 0x7F ; 127 34: 8f e7 ldi r24, 0x7F ; 127
36: 87 bb out 0x17, r24 ; 23 36: 87 bb out 0x17, r24 ; 23
while(1){ while(1){
PORTB = 255; PORTB = SC;
38: 8f ef ldi r24, 0xFF ; 255 38: 88 e7 ldi r24, 0x78 ; 120
3a: 88 bb out 0x18, r24 ; 24 3a: 88 bb out 0x18, r24 ; 24
#else #else
//round up by default //round up by default