avatar_bilsisco

msp430 çakar uygulaması

Başlatan bilsisco, 17 Ağustos 2015, 16:29:29

bilsisco

msp430 launchpad örnek bir uygulama


#include  <msp430.h>
volatile unsigned int i = 0;
void main(void)
{
  WDTCTL = WDTPW + WDTHOLD;

P1DIR |= BIT0; // P1.0 output, BIT0 is define as (0x0001) in the header file
P1OUT &= ~BIT0; // P1.0 output LOW, LED Off

P1DIR |= BIT6; // P1.6 output
P1OUT &= ~BIT6; // P1.6 output LOW, LED Off

for (;;)
{
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);
P1OUT ^= BIT0;
for(i=0; i< 10000; i++);

P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
P1OUT ^= BIT6;
for(i=0; i< 10000; i++);
 
}
}

https://www.youtube.com/watch?v=LvrgfSWcGnM

Powered by EzPortal