Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * BasicIO1.c
- *
- * Created: 9/11/2016 11:54:18 AM
- * Author : Alin
- */
- #define F_CPU 16000000UL
- #include <stdio.h>
- #include <avr/io.h>
- #include <util/delay.h>
- #include "usart.h"
- int main(void) {
- uart_init(); // open the communication to the microcontroller
- io_redirect(); // redirect input and output to the uart
- int input = 0;
- int max = -INFINITY;
- int min = INFINITY;
- while(1) {
- printf("Input Temperature\n");
- scanf("%d", &input);
- if (input > max)
- max = input;
- if (input < min)
- min = input;
- printf ("Max = %d", max);
- printf(" Min = %d", min);
- printf(" Current = %d\n", input);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement