| Code
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
int leds[9] = {0,1,2,4,8,16,32,64,128};
int i;
for(i=9;i>=0;i--)
{
_outp(0x378,leds[i]);
_sleep(1000);
}
return 0;
}
Description
The values to be outputted
are stored in an array and we then
loop through them one a ta time.
Download
walkingledsdown.txt
|