Kod: Zaznacz cały
#define CHIP_6713 1
#include"konfiguracjacfg.h"
#include <csl.h>
#include <dsk6713.h>
#include <dsk6713_led.h>
#include <dsk6713_dip.h>
unsigned char przel[4]={0,0,0,0}, a=0, x=0, p;
void main(void)
{
CSL_init();
DSK6713_init();
DSK6713_LED_init();
DSK6713_DIP_init();
//przel[0]=DSK6713_DIP_get(0);
//DSK6713_LED_off(0);
//DSK6713_LED_on(0);
//DSK6713_LED_toggle(0);
}
void funkcja_1sekunda(void)
{
x++;
przel[0]=DSK6713_DIP_get(0);
przel[1]=DSK6713_DIP_get(1);
przel[2]=DSK6713_DIP_get(2);
przel[3]=DSK6713_DIP_get(3);
p=przel[0]+(przel[1]*2)+(przel[2]*4)+(przel[3]*8);
if(x==p) {
a++;
if(a==1) {
DSK6713_LED_on(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_off(3);
}
if(a==2) {
DSK6713_LED_on(0);
DSK6713_LED_on(1);
DSK6713_LED_off(2);
DSK6713_LED_on(3);
}
if(a==3) {
DSK6713_LED_on(0);
DSK6713_LED_off(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
}
if(a==4) {
DSK6713_LED_off(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
}
if(a==5) {
DSK6713_LED_off(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
}
if(a==6) {
DSK6713_LED_off(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
}
if(a==7) {
DSK6713_LED_off(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
}
if(a==7) {
DSK6713_LED_off(0);
DSK6713_LED_on(1);
DSK6713_LED_on(2);
DSK6713_LED_on(3);
a=0;
}
x=0;
}
if(x==16){
x=0;
}
}