| Electronic Components Datasheet Search |
|
DFR0274 Datasheet(PDF) 8 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
DFR0274 Datasheet(HTML) 8 Page - DFROBOT |
|
8 / 12 page ![]() while(pulseIn(IR_PIN, HIGH) < BIT_START); read_pulse(pulse); pulse_to_bits(pulse, bits); RemoteVerify(bits); return bits_to_int(bits); } /* use pulseIn to receive IR pulses from the remote. Record the length of these pulses (in ms) in an array */ void read_pulse(int pulse[]) { for (int i = 0; i < IR_BIT_LENGTH; i++) { pulse[i] = pulseIn(IR_PIN, HIGH); } } /* IR pulses encode binary "0" as a short pulse, and binary "1" as a long pulse. Given an array containing pulse lengths, convert this to an array containing binary values */ void pulse_to_bits(int pulse[], int bits[]) { if (debug) { Serial.println("-----"); } for(int i = 0; i < IR_BIT_LENGTH; i++) { if (debug) { Serial.println(pulse[i]); } if(pulse[i] > BIT_1) //is it a 1? { bits[i] = 1; } else if(pulse[i] > BIT_0) //is it a 0? { bits[i] = 0; } else //data is invalid... { Serial.println("Error"); } } } /* check returns proper first 14 check bits */ void RemoteVerify(int bits[]) { int result = 0; int seed = 1; |
|
|
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 |