/* Before you start, select your target, on the right of the "Load" button */
int main(void)
/* Before you start, select your target, on the right of the "Load" button */
int main(void)
{
		while (1) {
			TM_DISCO_LedToggle(LED_RED | LED_GREEN);
			Delayms(100);
		}
	}
	while (1) {
		TM_HCSR04_Read(&HCSR04);
		if (HCSR04.Distance < 0) {
			TM_DISCO_LedOn(LED_RED);
			TM_DISCO_LedOff(LED_GREEN);
		} else if (HCSR04.Distance > 50) {
			TM_DISCO_LedOn(LED_GREEN);
			TM_DISCO_LedOff(LED_RED);
		} else {
			TM_DISCO_LedOff(LED_GREEN | LED_RED);
		}
		Delayms(100);
	}
}