/* Arlotto 2005 : pgm test robot rabbit pic */ #include #include //#define __DEBUG // à commenter pour mode autonome #ifdef __DEBUG __CONFIG (0x3739); #else __CONFIG(0x3D39); #endif #include "biosdem.h" #include "sonar.h" #include "serial.h" void main (void) { int distance ; char distance_str[8]=""; init_i2c(); init_serial(); for ( ; ; ) { distance = read_distance(); sprintf(distance_str,"%4d\r",distance); serial_puts(distance_str); } }