| Electronic Components Datasheet Search |
|
DFR0305 Datasheet(PDF) 8 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
DFR0305 Datasheet(HTML) 8 Page - DFROBOT |
|
8 / 18 page ![]() int adc_key_val[5] ={50, 200, 400, 600, 800 }; int NUM_KEYS = 5; int adc_key_in; int key=-1; int oldkey=-1; void setup(){ pinMode(13, OUTPUT); //LED13 is used for mesure the button state. Serial.begin(115200); } void loop(){ adc_key_in = analogRead(7); digitalWrite(13,LOW); key = get_key(adc_key_in); //Call the button judging function. if (key != oldkey){ // Get the button pressed delay(50); adc_key_in = analogRead(7); key = get_key(adc_key_in); if (key != oldkey) { oldkey = key; if (key >=0){ digitalWrite(13,HIGH); switch(key){ // Send messages accordingly. case 0:Serial.println("S1 OK"); break; case 1:Serial.println("S2 OK"); break; case 2:Serial.println("S3 OK"); break; case 3:Serial.println("S4 OK"); break; case 4:Serial.println("S5 OK"); |
|
|
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 |