Escribe el siguiente código en un fichero llamado display7.c: 1 2 3
# i n c l u d e < a v r / i o . h> / / I /O # i n c l u d e < a v r / pgmspace . h> / / Acceso Memoria F l a s h
4 5
c o n s t char t a b l a [ ] PROGMEM = {0 x3F , 0 x06 , 0 x5B } ; / / L e t r a s
6 7
i n t main ( ) {
8
u n s i g n e d char DDRD = 0 x00 ; 11 PORTD = 0xFF ; 12 DDRB = 0xFF ; 9
10
dato ; / / P u e r t o D como e n t r a d a / / R e s i s t o r e s P u l l Up / / P u e r t o B como s a l i d a
13 14
while ( 1 ) {
15
d a t o = PIND & 0 x0F ; / / Lee p u e r t o D PORTB = p g m _ r e a d _ b y t e (& t a b l a [ d a t o ] ) ; / / Acceso a F l a s h }
16 17 18 19
}
1