/** * Initialisation des differents capteurs et du bluetooth */ void init(void) { nx_display_clear(); nx_display_cursor_set_pos(0, 0); nx_display_string("Lo52 project\n"); nx_display_cursor_set_pos(0, 2); //on affiche le niveau de la batterie nx_display_uint(nx_avr_get_battery_voltage()); nx_display_cursor_set_pos(4, 2); nx_display_string("/4000\n"); nx_systick_install_scheduler(watchdog); // initialise le radar ultrason nx_radar_init(RADAR_SENSOR); //initialise le bluetooth bt_init(); nx_display_string("bluetooth...OK"); //initialise le son nx__sound_init(); // initialise le capteur de contact nx_sensors_analog_enable(TOUCH_SENSOR); //initialise le capteur de luminosité nx_sensors_analog_enable(LIGHT_SENSOR); nx_sensors_analog_digi_set(LIGHT_SENSOR, DIGI0); }
static void core_init(void) { nx__aic_init(); nx_interrupts_enable(); nx__systick_init(); nx__sound_init(); nx__avr_init(); nx__motors_init(); nx__lcd_init(); nx__display_init(); nx__sensors_init(); nx__usb_init(); nx_i2c_init(); // TODO: should be nx__i2c_init(). /* Delay a little post-init, to let all the drivers settle down. */ nx_systick_wait_ms(100); }