File: demo.c

package info (click to toggle)
simulavr 0.1.2.2-6.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,756 kB
  • ctags: 3,179
  • sloc: ansic: 19,987; sh: 3,623; python: 3,528; makefile: 406; asm: 308; yacc: 145; lex: 48
file content (26 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * $Id: demo.c,v 1.6 2003/09/10 04:59:36 troth Exp $
 *
 * Counter from 0xff down to 0x00, output to leds ~cnt.
 */

#include <inttypes.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "common.h"

int main(void)
{
#if TEST_BIG_STR
#   include "big_str.h"
#endif /* TEST_BIG_STR */

    uint8_t cnt;

    DDRB = 0xff;                /* enable port b for output */

    for ( cnt=0xff; cnt > 0; cnt-- )
        PORTB = cnt;

    return 0;
}