Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <led.h>
- #include <button.h>
- void main(void) {
- int8_t counter = 0;
- int8_t old_state = sb_button_getState(BUTTON0);
- while(1) {
- int new_state = sb_button_getState(BUTTON0);
- if (old_state != new_state){
- counter++;
- }
- old_state = new_state;
- if (counter==2){
- sb_led_on(GREEN1);
- for( volatile uint16_t a = 0; a < 25000 ; a++){
- }
- sb_led_off (GREEN1);
- for( volatile uint16_t a = 0; a < 25000 ; a++){
- }
- counter = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement