Closed emadmasri40 closed 5 years ago
int main() { char K[2]; static int TEM1 = 0; static int save = 0; char word[3]; int i; int j = 0; volatile int num;
INT_TIMER();
INT_PWM();
INT_TEM();
INT_UART_1();
INT_UART_0();
while (1)
{
TEM1 = READ_TEM();
if (save != TEM1)
{
j = 0;
save = TEM1;
sprintf(K, "%d", TEM1);
for (i = 0; i < 2; i++)
{
word[i] = K[j++];
}
word[2] = 'C';
send_UARTA1(word);
delayms(1000);
}
}
}
Launchpad 1 will be connected to a motor (for example it can be used to rotate a surveillance camera), a temperature sensor, and a LED (it can be analogous to lighting system in general).