Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void init()
- {
- //calib clock @ 8MHz
- uint8_t osccal_data = pgm_read_byte(CLK_CALIB_DATA);
- if (osccal_data != 0xff) OSCCAL = osccal_data;
- //adc
- a2dInit();
- fSnd = 0;
- fReset = 0;
- //port
- DDRB = 0xff;
- DDRD = 0xff;
- return;
- }
- void calib_adc(void)
- {
- uint8_t i;
- uint16_t sval = 0;
- for (i=0; i<100; i++){
- sval += a2dConvert8bit(ADC_CH_ADC0);
- }
- adc_zero = sval / 100;
- //PRINT(" adczero = %x\n", adc_zero);
- wait = 303;
- return;
- }
Add Comment
Please, Sign In to add comment