/*Programed by Akihisa ONODA*/

#include"stdio.h"
#include"serial_func.h"

int main(void){
	int sel,dat;

	while(1){

		printf("PLEASE SELECT THE SENSOR NUMBER.\n* 9:END\n");
		scanf("%d",&sel);

		if(sel == 9){
			printf("\n(/_;)/~~ \n");
			break;

		}

		else if(sel != 0 && sel != 1&& sel != 2){
			printf("ERROR\n");
		}

		else{
			dat = serial_data('U',sel);
			printf("USS%d = %d[cm]\n\n",sel,dat);
		}
	}
}