Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <main.h>
- #define TIME_DELAY 500
- #define BxOUT 0x00
- const char PIN_ARR[] = {PIN_B0, PIN_B1, PIN_B2, PIN_B3, PIN_B4, PIN_B5, PIN_B6, PIN_B7};
- void main(){
- set_tris_b(BxOUT);
- output_B(BxOUT);
- // int i;
- while(TRUE){
- for (int i = 0; i < 8; i++){
- output_high(PIN_ARR[i]);
- delay_ms(TIME_DELAY);
- }
- //turn off all leds
- output_B(BxOUT);
- delay_ms(TIME_DELAY);
- for (int j = 7; j >= 0; j--){
- output_high(PIN_ARR[j]);
- delay_ms(TIME_DELAY);
- }
- //turn off all leds
- output_B(BxOUT);
- delay_ms(TIME_DELAY);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement