/Designs/galileo_experiment/SW/main.c |
---|
46,13 → 46,10 |
enable_interrupts(GLOBAL); |
setup_adc_ports(AN0_TO_AN2|VSS_VREF); |
setup_adc(ADC_CLOCK_DIV_64); |
setup_adc(ADC_CLOCK_DIV_32); |
usb_init(); // initialise USB module |
while (TRUE) |
{ |
while(!usb_cdc_connected()); |
time=0; |
set_timer0(0); |
86,4 → 83,3 |
printf(usb_cdc_putc, "%7.3f %4.3f %4.3f %4.3f %4.3f %4.3f %4.3f \n\r",((time << 16) + get_timer0())/15625.0, xavg, quadraticerror(xavg,x,BUFLEN), yavg, quadraticerror(yavg,y,BUFLEN), zavg, quadraticerror(zavg,z,BUFLEN)); //konstanta k je kvuli prevodu do rozzumnych jednotek [s] |
} |
} |
} |