#include "led.h"
void setup() {
volatile char *portf_dir = (char *)0x30;
*portf_dir = 0xFF;
volatile char *portf_data = (char *)0x31;
int get=0,i=0;
int count =1;
unsigned long delay = 0;
while(1)
{
if(count > 0 && count < 9)
{
if(++delay == 80000 * (i+1))
{
get = (1<<i);
*portf_data = *portf_data | get;
i++;
count++;
}
if(i == 8)
{
delay = 0;
i = 0;
}
}
else if(count > 8 && count < 17)
{
if(++delay == 80000 * (i+1))
{
get = (1<<i);
*portf_data = *portf_data &(~get);
i++;
count++;
}
if(i == 8)
{
delay = 0;
i = 7;
}
}
else if(count > 16 && count < 25)
{
if(++delay == 80000 * (8-i))
{
get = (1<<i);
*portf_data = *portf_data | get;
i--;
count++;
}
if(i == -1)
{
delay = 0;
i = 7;
}
}
else if(count > 24 && count < 33)
{
if(++delay == 80000 * (8 - i))
{
get = (1<<i);
*portf_data = *portf_data & (~get);
i--;
count++;
}
if(i == -1)
{
delay = 0;
i = 0;
}
}
else
{
count = 1;
}
}
}
void loop() {
}