//retrieve the x&y values of the accelerometer void accel_get_val () { uint8_t x, y; accel_on(); //turn accel on to read value dev_ioctl(DEV_ADC, ADC_SET_CHANNEL, 1); dev_read(DEV_ADC, &x, sizeof(x)); dev_ioctl(DEV_ADC, ADC_SET_CHANNEL, 1); dev_read(DEV_ADC, &y, sizeof(y)); accel_off(); //turn off accel printf("%C\t%C\n",x,y); }
void sensor_endable_cmd() { accel_on(); return; }