Skip to content

Instantly share code, notes, and snippets.

@Anubisss
Created December 24, 2013 23:12
Show Gist options
  • Save Anubisss/8118688 to your computer and use it in GitHub Desktop.
Save Anubisss/8118688 to your computer and use it in GitHub Desktop.
Testing a seven-segment TIL309 red LED display with a MSP430 microcontroller
//#include <msp430g2553.h>
#include <msp430.h>
int main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR = BIT1 | BIT2 | BIT3 | BIT4 | BIT5; // make port 1.1-1.5 to output
unsigned char c = 0x00;
while (1)
{
P1OUT = c << 1;
__delay_cycles(300000);
if (c++ == 0x0F)
c = 0;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment