Created
December 24, 2013 23:12
-
-
Save Anubisss/8118688 to your computer and use it in GitHub Desktop.
Testing a seven-segment TIL309 red LED display with a MSP430 microcontroller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#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