~ubuntu-branches/ubuntu/dapper/simulavr/dapper

« back to all changes in this revision

Viewing changes to test_c/demo.c

  • Committer: Bazaar Package Importer
  • Author(s): Shaun Jackman
  • Date: 2004-04-10 13:54:17 UTC
  • Revision ID: james.westby@ubuntu.com-20040410135417-zywapjyz252y65se
Tags: upstream-0.1.2.1
ImportĀ upstreamĀ versionĀ 0.1.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: demo.c,v 1.6 2003/09/10 04:59:36 troth Exp $
 
3
 *
 
4
 * Counter from 0xff down to 0x00, output to leds ~cnt.
 
5
 */
 
6
 
 
7
#include <inttypes.h>
 
8
#include <avr/io.h>
 
9
#include <avr/pgmspace.h>
 
10
#include "common.h"
 
11
 
 
12
int main(void)
 
13
{
 
14
#if TEST_BIG_STR
 
15
#   include "big_str.h"
 
16
#endif /* TEST_BIG_STR */
 
17
 
 
18
    uint8_t cnt;
 
19
 
 
20
    DDRB = 0xff;                /* enable port b for output */
 
21
 
 
22
    for ( cnt=0xff; cnt > 0; cnt-- )
 
23
        PORTB = cnt;
 
24
 
 
25
    return 0;
 
26
}