Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <16f628.h>
- #use delay(clock=4M)
- #define led1 pin_a0
- #define led2 pin_a1
- #define tasto1 pin_a2
- void led_1(); // led1
- void led_2(); // led2
- void tasto_1(); // tasto1
- int main(){
- led_1();
- led_2();
- while(1)
- tasto_1();
- return 0;
- }
- void led_1(){
- output_high(led1); // accende led2 su pin a1
- delay_ms(500);
- output_low(led1); // spegne led2 su pin a1
- delay_ms(500);
- }
- void led_2(){
- {
- output_high(led2); // accende led2 su pin a1
- delay_ms(500);
- output_low(led2); // spegne led2 su pin a1
- delay_ms(500);
- }
- }
- void tasto_1(){
- if(!tasto1==1)
- output_high(led1);
- else
- output_low(led1);
- }
Add Comment
Please, Sign In to add comment