forked from KarenWest/EmbeddedSystems_Lab11_UART
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
31 lines (27 loc) · 962 Bytes
/
main.c
File metadata and controls
31 lines (27 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// main.c
// Runs on LM4F120/TM4C123
// Test main for Lab 11
// January 3, 2014
// this connection occurs in the USB debugging cable
// U0Rx (PA0) connected to serial port on PC
// U0Tx (PA1) connected to serial port on PC
// Ground connected ground in the USB cable
#include "UART.h"
#include "TExaS.h"
void EnableInterrupts(void); // Enable interrupts
// do not edit this main
// your job is to implement the UART_OutUDec UART_OutDistance functions
int main(void){ unsigned long n;
TExaS_Init(); // initialize grader, set system clock to 80 MHz
UART_Init(); // initialize UART
EnableInterrupts(); // needed for TExaS
UART_OutString("Running Lab 11");
while(1){
UART_OutString("\n\rInput:");
n = UART_InUDec();
UART_OutString(" UART_OutUDec = ");
UART_OutUDec(n); // your function
UART_OutString(", UART_OutDistance ~ ");
UART_OutDistance(n); // your function
}
}