Skip to content

Instantly share code, notes, and snippets.

@ss23
Created May 12, 2012 05:48
Show Gist options
  • Save ss23/2664412 to your computer and use it in GitHub Desktop.
Save ss23/2664412 to your computer and use it in GitHub Desktop.
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0x40; // Set P1.0 to output direction
for (;;)
{
volatile unsigned int j;
j = P1IN & 0x10;
if (j) {
P1OUT = 0x40;
} else {
P1OUT = 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment