Ledi iki kere butona basıp yakmak( MSP430 Uygulamaları C++ )
#include "io430.h"// ledi iki kere butona basıp yakmak. iki kere // bastık led yandı . Tekrar bastık led söndü , iki kere tekrar bas //led yansın P1.0 P1.6 LED KOY void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR= 0x41; P1OUT=0x00; long int i; int sayac=1; while (1) { if (!(P1IN & 0x08)) { ++sayac; if (sayac %3 == 0 ){ P1OUT = 0x41; i=0; while(i<100000) ++i;} else {P1OUT = 0x00; i=0; while(i<100000) i++;} while(!(P1IN & 0x08)); } } }