Projet

Général

Profil

Publication de fichiers » kitt_scan.c

Redmine Admin, 2013-02-17 12:27

 
/*
* test.c
*
* Created on: Aug 3, 2009 Author: Patrice Nadeau
* Last modification on: Aug 9, 2009 By: Patrice Nadeau
* Knight Rider KITT / KARR scanner effect on Atmel ATMega328p on PORTD
*/

#include <avr/io.h>
#include <util/delay.h>

/* Table that contain the pattern, active low (sinking) */
uint8_t scan[16] = {0xfe, 0xfc, 0xf9, 0xf3, 0xe7, 0xcf, 0x9f, 0x3f, 0x7f, 0x3f, 0x9f, 0xcf, 0xe7, 0xf3, 0xf9, 0xfc};


int main(void) {
uint8_t x;
DDRD = 0xff;
PORTD = 0xff;
while (1) {
for (x = 0; x < 15; x++) {
PORTD = scan[x];
_delay_ms(100);
};
};
return 0;
}

(1-1/2)