| Electronic Components Datasheet Search |
|
DS41356B Datasheet(PDF) 30 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
DS41356B Datasheet(HTML) 30 Page - Microchip Technology |
|
30 / 54 page ![]() Low Pin Count USB Development Kit User’s Guide DS41356B-page 26 © 2009 Microchip Technology Inc. EXAMPLE 2-9: KEYBOARD() STATE MACHINE CODE //delay to allow the hold capacitor on the ADC to charge case 0: if(++delaycounter>9000) { delaycounter = 0; state = 1; } break; case 1: ADCON0bits.GO_DONE = 1; //Start an ADC conversion state = 2; break; case 2: if(ADCON0bits.GO_DONE == 0) //Check if conversion is //completed { state = 3; } break; case 3: HIDoutput = ADRESH>>3;//shift the result in ADRESH //left by three if(HIDoutput<=4) HIDoutput = 4; if(HIDoutput>=29) HIDoutput = 29; //Can the SIE transmit? if((HIDTxHandleBusy(lastTransmission) == 0)) { //Load the HID buffer hid_report_in[0] = 0; hid_report_in[1] = 0; hid_report_in[2] = HIDoutput; hid_report_in[3] = 0; hid_report_in[4] = 0; hid_report_in[5] = 0; hid_report_in[6] = 0; hid_report_in[7] = 0; //Send the 8 byte packet over USB to the host. lastTransmission = HIDTxPacket(HID_EP, (BYTE*)hid_report_in, 0x08); state = 0; } break; |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |