linksprite_lcd_shield_v2.ino.elf: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 5d 00 jmp 0xba ; 0xba <__ctors_end> 4: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 8: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 10: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 14: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 18: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 1c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 20: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 24: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 28: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 2c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 30: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 34: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 38: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 3c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 40: 0c 94 fb 02 jmp 0x5f6 ; 0x5f6 <__vector_16> 44: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 48: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 4c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 50: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 54: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 58: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 5c: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 60: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 64: 0c 94 85 00 jmp 0x10a ; 0x10a <__bad_interrupt> 00000068 <__trampolines_end>: 68: 00 00 nop 6a: 00 08 sbc r0, r0 6c: 00 02 muls r16, r16 6e: 01 00 .word 0x0001 ; ???? 70: 00 03 mulsu r16, r16 72: 04 07 cpc r16, r20 ... 0000007c : 7c: 00 00 00 00 25 00 28 00 2b 00 ....%.(.+. 00000086 : 86: 00 00 00 00 24 00 27 00 2a 00 ....$.'.*. 00000090 : 90: 04 04 04 04 04 04 04 04 02 02 02 02 02 02 03 03 ................ a0: 03 03 03 03 .... 000000a4 : a4: 01 02 04 08 10 20 40 80 01 02 04 08 10 20 01 02 ..... @...... .. b4: 04 08 10 20 ... 000000b8 <__ctors_start>: b8: 67 04 cpc r6, r7 000000ba <__ctors_end>: ba: 11 24 eor r1, r1 bc: 1f be out 0x3f, r1 ; 63 be: cf ef ldi r28, 0xFF ; 255 c0: d8 e0 ldi r29, 0x08 ; 8 c2: de bf out 0x3e, r29 ; 62 c4: cd bf out 0x3d, r28 ; 61 000000c6 <__do_copy_data>: c6: 11 e0 ldi r17, 0x01 ; 1 c8: a0 e0 ldi r26, 0x00 ; 0 ca: b1 e0 ldi r27, 0x01 ; 1 cc: e6 e2 ldi r30, 0x26 ; 38 ce: f9 e0 ldi r31, 0x09 ; 9 d0: 02 c0 rjmp .+4 ; 0xd6 <__do_copy_data+0x10> d2: 05 90 lpm r0, Z+ d4: 0d 92 st X+, r0 d6: aa 3a cpi r26, 0xAA ; 170 d8: b1 07 cpc r27, r17 da: d9 f7 brne .-10 ; 0xd2 <__do_copy_data+0xc> 000000dc <__do_clear_bss>: dc: 21 e0 ldi r18, 0x01 ; 1 de: aa ea ldi r26, 0xAA ; 170 e0: b1 e0 ldi r27, 0x01 ; 1 e2: 01 c0 rjmp .+2 ; 0xe6 <.do_clear_bss_start> 000000e4 <.do_clear_bss_loop>: e4: 1d 92 st X+, r1 000000e6 <.do_clear_bss_start>: e6: ad 3c cpi r26, 0xCD ; 205 e8: b2 07 cpc r27, r18 ea: e1 f7 brne .-8 ; 0xe4 <.do_clear_bss_loop> 000000ec <__do_global_ctors>: ec: 10 e0 ldi r17, 0x00 ; 0 ee: cd e5 ldi r28, 0x5D ; 93 f0: d0 e0 ldi r29, 0x00 ; 0 f2: 04 c0 rjmp .+8 ; 0xfc <__do_global_ctors+0x10> f4: 21 97 sbiw r28, 0x01 ; 1 f6: fe 01 movw r30, r28 f8: 0e 94 86 04 call 0x90c ; 0x90c <__tablejump2__> fc: cc 35 cpi r28, 0x5C ; 92 fe: d1 07 cpc r29, r17 100: c9 f7 brne .-14 ; 0xf4 <__do_global_ctors+0x8> 102: 0e 94 45 03 call 0x68a ; 0x68a
106: 0c 94 91 04 jmp 0x922 ; 0x922 <_exit> 0000010a <__bad_interrupt>: 10a: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> 0000010e : #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { uint8_t bit = digitalPinToBitMask(pin); 10e: 90 e0 ldi r25, 0x00 ; 0 110: fc 01 movw r30, r24 112: ec 55 subi r30, 0x5C ; 92 114: ff 4f sbci r31, 0xFF ; 255 116: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 118: fc 01 movw r30, r24 11a: e0 57 subi r30, 0x70 ; 112 11c: ff 4f sbci r31, 0xFF ; 255 11e: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 120: 88 23 and r24, r24 122: 99 f0 breq .+38 ; 0x14a // JWS: can I let the optimizer do this? reg = portModeRegister(port); 124: 90 e0 ldi r25, 0x00 ; 0 126: 88 0f add r24, r24 128: 99 1f adc r25, r25 12a: fc 01 movw r30, r24 12c: ea 57 subi r30, 0x7A ; 122 12e: ff 4f sbci r31, 0xFF ; 255 130: a5 91 lpm r26, Z+ 132: b4 91 lpm r27, Z out = portOutputRegister(port); 134: fc 01 movw r30, r24 136: e4 58 subi r30, 0x84 ; 132 138: ff 4f sbci r31, 0xFF ; 255 13a: 85 91 lpm r24, Z+ 13c: 94 91 lpm r25, Z cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 13e: 8f b7 in r24, 0x3f ; 63 cli(); 140: f8 94 cli *reg |= bit; 142: ec 91 ld r30, X 144: e2 2b or r30, r18 146: ec 93 st X, r30 SREG = oldSREG; 148: 8f bf out 0x3f, r24 ; 63 14a: 08 95 ret 0000014c : // to 0 (the default). #if defined(ADMUX) #if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) ADMUX = (analog_reference << 4) | (pin & 0x07); #else ADMUX = (analog_reference << 6) | (pin & 0x07); 14c: 80 e4 ldi r24, 0x40 ; 64 14e: 80 93 7c 00 sts 0x007C, r24 // without a delay, we seem to read from the wrong channel //delay(1); #if defined(ADCSRA) && defined(ADCL) // start the conversion sbi(ADCSRA, ADSC); 152: 80 91 7a 00 lds r24, 0x007A 156: 80 64 ori r24, 0x40 ; 64 158: 80 93 7a 00 sts 0x007A, r24 // ADSC is cleared when the conversion finishes while (bit_is_set(ADCSRA, ADSC)); 15c: 80 91 7a 00 lds r24, 0x007A 160: 86 fd sbrc r24, 6 162: fc cf rjmp .-8 ; 0x15c // we have to read ADCL first; doing so locks both ADCL // and ADCH until ADCH is read. reading ADCL second would // cause the results of each conversion to be discarded, // as ADCL and ADCH would be locked when it completed. low = ADCL; 164: 80 91 78 00 lds r24, 0x0078 high = ADCH; 168: 20 91 79 00 lds r18, 0x0079 low = 0; high = 0; #endif // combine the two bytes return (high << 8) | low; 16c: 90 e0 ldi r25, 0x00 ; 0 } 16e: 92 2b or r25, r18 170: 08 95 ret 00000172 <_ZN5Print5writeEPKhj>: // Public Methods ////////////////////////////////////////////////////////////// /* default implementation: may be overridden */ size_t Print::write(const uint8_t *buffer, size_t size) { 172: cf 92 push r12 174: df 92 push r13 176: ef 92 push r14 178: ff 92 push r15 17a: 0f 93 push r16 17c: 1f 93 push r17 17e: cf 93 push r28 180: df 93 push r29 182: 6c 01 movw r12, r24 184: 7a 01 movw r14, r20 186: 8b 01 movw r16, r22 size_t n = 0; 188: c0 e0 ldi r28, 0x00 ; 0 18a: d0 e0 ldi r29, 0x00 ; 0 while (size--) { 18c: ce 15 cp r28, r14 18e: df 05 cpc r29, r15 190: 89 f0 breq .+34 ; 0x1b4 <_ZN5Print5writeEPKhj+0x42> if (write(*buffer++)) n++; 192: d8 01 movw r26, r16 194: 6d 91 ld r22, X+ 196: 8d 01 movw r16, r26 198: d6 01 movw r26, r12 19a: ed 91 ld r30, X+ 19c: fc 91 ld r31, X 19e: 01 90 ld r0, Z+ 1a0: f0 81 ld r31, Z 1a2: e0 2d mov r30, r0 1a4: c6 01 movw r24, r12 1a6: 09 95 icall 1a8: 89 2b or r24, r25 1aa: 11 f4 brne .+4 ; 0x1b0 <_ZN5Print5writeEPKhj+0x3e> 1ac: 7e 01 movw r14, r28 1ae: 02 c0 rjmp .+4 ; 0x1b4 <_ZN5Print5writeEPKhj+0x42> 1b0: 21 96 adiw r28, 0x01 ; 1 1b2: ec cf rjmp .-40 ; 0x18c <_ZN5Print5writeEPKhj+0x1a> else break; } return n; } 1b4: c7 01 movw r24, r14 1b6: df 91 pop r29 1b8: cf 91 pop r28 1ba: 1f 91 pop r17 1bc: 0f 91 pop r16 1be: ff 90 pop r15 1c0: ef 90 pop r14 1c2: df 90 pop r13 1c4: cf 90 pop r12 1c6: 08 95 ret 000001c8 : } } void digitalWrite(uint8_t pin, uint8_t val) { uint8_t timer = digitalPinToTimer(pin); 1c8: 90 e0 ldi r25, 0x00 ; 0 1ca: fc 01 movw r30, r24 1cc: e8 59 subi r30, 0x98 ; 152 1ce: ff 4f sbci r31, 0xFF ; 255 1d0: 34 91 lpm r19, Z uint8_t bit = digitalPinToBitMask(pin); 1d2: fc 01 movw r30, r24 1d4: ec 55 subi r30, 0x5C ; 92 1d6: ff 4f sbci r31, 0xFF ; 255 1d8: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1da: fc 01 movw r30, r24 1dc: e0 57 subi r30, 0x70 ; 112 1de: ff 4f sbci r31, 0xFF ; 255 1e0: e4 91 lpm r30, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1e2: ee 23 and r30, r30 1e4: 09 f4 brne .+2 ; 0x1e8 1e6: 3b c0 rjmp .+118 ; 0x25e // If the pin that support PWM output, we need to turn it off // before doing a digital write. if (timer != NOT_ON_TIMER) turnOffPWM(timer); 1e8: 33 23 and r19, r19 1ea: 39 f1 breq .+78 ; 0x23a // //static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline)); //static inline void turnOffPWM(uint8_t timer) static void turnOffPWM(uint8_t timer) { switch (timer) 1ec: 33 30 cpi r19, 0x03 ; 3 1ee: 91 f0 breq .+36 ; 0x214 1f0: 38 f4 brcc .+14 ; 0x200 1f2: 31 30 cpi r19, 0x01 ; 1 1f4: a9 f0 breq .+42 ; 0x220 1f6: 32 30 cpi r19, 0x02 ; 2 1f8: 01 f5 brne .+64 ; 0x23a #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: cbi(TCCR0A, COM0A1); break; #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: cbi(TCCR0A, COM0B1); break; 1fa: 84 b5 in r24, 0x24 ; 36 1fc: 8f 7d andi r24, 0xDF ; 223 1fe: 12 c0 rjmp .+36 ; 0x224 // //static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline)); //static inline void turnOffPWM(uint8_t timer) static void turnOffPWM(uint8_t timer) { switch (timer) 200: 37 30 cpi r19, 0x07 ; 7 202: 91 f0 breq .+36 ; 0x228 204: 38 30 cpi r19, 0x08 ; 8 206: a1 f0 breq .+40 ; 0x230 208: 34 30 cpi r19, 0x04 ; 4 20a: b9 f4 brne .+46 ; 0x23a { #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: cbi(TCCR1A, COM1A1); break; #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: cbi(TCCR1A, COM1B1); break; 20c: 80 91 80 00 lds r24, 0x0080 210: 8f 7d andi r24, 0xDF ; 223 212: 03 c0 rjmp .+6 ; 0x21a static void turnOffPWM(uint8_t timer) { switch (timer) { #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: cbi(TCCR1A, COM1A1); break; 214: 80 91 80 00 lds r24, 0x0080 218: 8f 77 andi r24, 0x7F ; 127 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: cbi(TCCR1A, COM1B1); break; 21a: 80 93 80 00 sts 0x0080, r24 21e: 0d c0 rjmp .+26 ; 0x23a #if defined(TCCR2) && defined(COM21) case TIMER2: cbi(TCCR2, COM21); break; #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: cbi(TCCR0A, COM0A1); break; 220: 84 b5 in r24, 0x24 ; 36 222: 8f 77 andi r24, 0x7F ; 127 #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: cbi(TCCR0A, COM0B1); break; 224: 84 bd out 0x24, r24 ; 36 226: 09 c0 rjmp .+18 ; 0x23a #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: cbi(TCCR2A, COM2A1); break; 228: 80 91 b0 00 lds r24, 0x00B0 22c: 8f 77 andi r24, 0x7F ; 127 22e: 03 c0 rjmp .+6 ; 0x236 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: cbi(TCCR2A, COM2B1); break; 230: 80 91 b0 00 lds r24, 0x00B0 234: 8f 7d andi r24, 0xDF ; 223 236: 80 93 b0 00 sts 0x00B0, r24 // If the pin that support PWM output, we need to turn it off // before doing a digital write. if (timer != NOT_ON_TIMER) turnOffPWM(timer); out = portOutputRegister(port); 23a: f0 e0 ldi r31, 0x00 ; 0 23c: ee 0f add r30, r30 23e: ff 1f adc r31, r31 240: e4 58 subi r30, 0x84 ; 132 242: ff 4f sbci r31, 0xFF ; 255 244: a5 91 lpm r26, Z+ 246: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 248: 8f b7 in r24, 0x3f ; 63 cli(); 24a: f8 94 cli if (val == LOW) { *out &= ~bit; 24c: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 24e: 61 11 cpse r22, r1 250: 03 c0 rjmp .+6 ; 0x258 *out &= ~bit; 252: 20 95 com r18 254: 2e 23 and r18, r30 256: 01 c0 rjmp .+2 ; 0x25a } else { *out |= bit; 258: 2e 2b or r18, r30 25a: 2c 93 st X, r18 } SREG = oldSREG; 25c: 8f bf out 0x3f, r24 ; 63 25e: 08 95 ret 00000260 : return m; } unsigned long micros() { unsigned long m; uint8_t oldSREG = SREG, t; 260: 3f b7 in r19, 0x3f ; 63 cli(); 262: f8 94 cli m = timer0_overflow_count; 264: 80 91 af 01 lds r24, 0x01AF 268: 90 91 b0 01 lds r25, 0x01B0 26c: a0 91 b1 01 lds r26, 0x01B1 270: b0 91 b2 01 lds r27, 0x01B2 #if defined(TCNT0) t = TCNT0; 274: 26 b5 in r18, 0x26 ; 38 #else #error TIMER 0 not defined #endif #ifdef TIFR0 if ((TIFR0 & _BV(TOV0)) && (t < 255)) 276: a8 9b sbis 0x15, 0 ; 21 278: 05 c0 rjmp .+10 ; 0x284 27a: 2f 3f cpi r18, 0xFF ; 255 27c: 19 f0 breq .+6 ; 0x284 m++; 27e: 01 96 adiw r24, 0x01 ; 1 280: a1 1d adc r26, r1 282: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV0)) && (t < 255)) m++; #endif SREG = oldSREG; 284: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 286: ba 2f mov r27, r26 288: a9 2f mov r26, r25 28a: 98 2f mov r25, r24 28c: 88 27 eor r24, r24 28e: 82 0f add r24, r18 290: 91 1d adc r25, r1 292: a1 1d adc r26, r1 294: b1 1d adc r27, r1 296: bc 01 movw r22, r24 298: cd 01 movw r24, r26 29a: 42 e0 ldi r20, 0x02 ; 2 29c: 66 0f add r22, r22 29e: 77 1f adc r23, r23 2a0: 88 1f adc r24, r24 2a2: 99 1f adc r25, r25 2a4: 4a 95 dec r20 2a6: d1 f7 brne .-12 ; 0x29c } 2a8: 08 95 ret 000002aa : void delay(unsigned long ms) { 2aa: 8f 92 push r8 2ac: 9f 92 push r9 2ae: af 92 push r10 2b0: bf 92 push r11 2b2: cf 92 push r12 2b4: df 92 push r13 2b6: ef 92 push r14 2b8: ff 92 push r15 2ba: 6b 01 movw r12, r22 2bc: 7c 01 movw r14, r24 uint32_t start = micros(); 2be: 0e 94 30 01 call 0x260 ; 0x260 2c2: 4b 01 movw r8, r22 2c4: 5c 01 movw r10, r24 while (ms > 0) { 2c6: c1 14 cp r12, r1 2c8: d1 04 cpc r13, r1 2ca: e1 04 cpc r14, r1 2cc: f1 04 cpc r15, r1 2ce: f1 f0 breq .+60 ; 0x30c yield(); while ( ms > 0 && (micros() - start) >= 1000) { 2d0: 0e 94 30 01 call 0x260 ; 0x260 2d4: dc 01 movw r26, r24 2d6: cb 01 movw r24, r22 2d8: 88 19 sub r24, r8 2da: 99 09 sbc r25, r9 2dc: aa 09 sbc r26, r10 2de: bb 09 sbc r27, r11 2e0: 88 3e cpi r24, 0xE8 ; 232 2e2: 93 40 sbci r25, 0x03 ; 3 2e4: a1 05 cpc r26, r1 2e6: b1 05 cpc r27, r1 2e8: 70 f3 brcs .-36 ; 0x2c6 ms--; 2ea: 21 e0 ldi r18, 0x01 ; 1 2ec: c2 1a sub r12, r18 2ee: d1 08 sbc r13, r1 2f0: e1 08 sbc r14, r1 2f2: f1 08 sbc r15, r1 start += 1000; 2f4: 88 ee ldi r24, 0xE8 ; 232 2f6: 88 0e add r8, r24 2f8: 83 e0 ldi r24, 0x03 ; 3 2fa: 98 1e adc r9, r24 2fc: a1 1c adc r10, r1 2fe: b1 1c adc r11, r1 { uint32_t start = micros(); while (ms > 0) { yield(); while ( ms > 0 && (micros() - start) >= 1000) { 300: c1 14 cp r12, r1 302: d1 04 cpc r13, r1 304: e1 04 cpc r14, r1 306: f1 04 cpc r15, r1 308: 19 f7 brne .-58 ; 0x2d0 30a: dd cf rjmp .-70 ; 0x2c6 ms--; start += 1000; } } } 30c: ff 90 pop r15 30e: ef 90 pop r14 310: df 90 pop r13 312: cf 90 pop r12 314: bf 90 pop r11 316: af 90 pop r10 318: 9f 90 pop r9 31a: 8f 90 pop r8 31c: 08 95 ret 0000031e <_ZN13LiquidCrystal11pulseEnableEv>: write4bits(value>>4); write4bits(value); } } void LiquidCrystal::pulseEnable(void) { 31e: cf 93 push r28 320: df 93 push r29 322: ec 01 movw r28, r24 digitalWrite(_enable_pin, LOW); 324: 60 e0 ldi r22, 0x00 ; 0 326: 8e 81 ldd r24, Y+6 ; 0x06 328: 0e 94 e4 00 call 0x1c8 ; 0x1c8 delayMicroseconds(1); digitalWrite(_enable_pin, HIGH); 32c: 61 e0 ldi r22, 0x01 ; 1 32e: 8e 81 ldd r24, Y+6 ; 0x06 330: 0e 94 e4 00 call 0x1c8 ; 0x1c8 delayMicroseconds(1); // enable pulse must be >450ns digitalWrite(_enable_pin, LOW); 334: 60 e0 ldi r22, 0x00 ; 0 336: 8e 81 ldd r24, Y+6 ; 0x06 338: 0e 94 e4 00 call 0x1c8 ; 0x1c8 #endif // busy wait __asm__ __volatile__ ( 33c: 8b e8 ldi r24, 0x8B ; 139 33e: 91 e0 ldi r25, 0x01 ; 1 340: 01 97 sbiw r24, 0x01 ; 1 342: f1 f7 brne .-4 ; 0x340 <_ZN13LiquidCrystal11pulseEnableEv+0x22> delayMicroseconds(100); // commands need > 37us to settle } 344: df 91 pop r29 346: cf 91 pop r28 348: 08 95 ret 0000034a <_ZN13LiquidCrystal10write4bitsEh>: void LiquidCrystal::write4bits(uint8_t value) { 34a: cf 92 push r12 34c: df 92 push r13 34e: ef 92 push r14 350: ff 92 push r15 352: 0f 93 push r16 354: 1f 93 push r17 356: cf 93 push r28 358: df 93 push r29 35a: 7c 01 movw r14, r24 35c: 6c 01 movw r12, r24 35e: 87 e0 ldi r24, 0x07 ; 7 360: c8 0e add r12, r24 362: d1 1c adc r13, r1 for (int i = 0; i < 4; i++) { 364: c0 e0 ldi r28, 0x00 ; 0 366: d0 e0 ldi r29, 0x00 ; 0 digitalWrite(_data_pins[i], (value >> i) & 0x01); 368: 06 2f mov r16, r22 36a: 10 e0 ldi r17, 0x00 ; 0 36c: b8 01 movw r22, r16 36e: 0c 2e mov r0, r28 370: 02 c0 rjmp .+4 ; 0x376 <_ZN13LiquidCrystal10write4bitsEh+0x2c> 372: 75 95 asr r23 374: 67 95 ror r22 376: 0a 94 dec r0 378: e2 f7 brpl .-8 ; 0x372 <_ZN13LiquidCrystal10write4bitsEh+0x28> 37a: 61 70 andi r22, 0x01 ; 1 37c: f6 01 movw r30, r12 37e: 81 91 ld r24, Z+ 380: 6f 01 movw r12, r30 382: 0e 94 e4 00 call 0x1c8 ; 0x1c8 digitalWrite(_enable_pin, LOW); delayMicroseconds(100); // commands need > 37us to settle } void LiquidCrystal::write4bits(uint8_t value) { for (int i = 0; i < 4; i++) { 386: 21 96 adiw r28, 0x01 ; 1 388: c4 30 cpi r28, 0x04 ; 4 38a: d1 05 cpc r29, r1 38c: 79 f7 brne .-34 ; 0x36c <_ZN13LiquidCrystal10write4bitsEh+0x22> digitalWrite(_data_pins[i], (value >> i) & 0x01); } pulseEnable(); 38e: c7 01 movw r24, r14 } 390: df 91 pop r29 392: cf 91 pop r28 394: 1f 91 pop r17 396: 0f 91 pop r16 398: ff 90 pop r15 39a: ef 90 pop r14 39c: df 90 pop r13 39e: cf 90 pop r12 void LiquidCrystal::write4bits(uint8_t value) { for (int i = 0; i < 4; i++) { digitalWrite(_data_pins[i], (value >> i) & 0x01); } pulseEnable(); 3a0: 0c 94 8f 01 jmp 0x31e ; 0x31e <_ZN13LiquidCrystal11pulseEnableEv> 000003a4 <_ZN13LiquidCrystal4sendEhh>: } /************ low level data pushing commands **********/ // write either command or data, with automatic 4/8-bit selection void LiquidCrystal::send(uint8_t value, uint8_t mode) { 3a4: cf 92 push r12 3a6: df 92 push r13 3a8: ef 92 push r14 3aa: ff 92 push r15 3ac: 0f 93 push r16 3ae: 1f 93 push r17 3b0: cf 93 push r28 3b2: df 93 push r29 3b4: ec 01 movw r28, r24 3b6: f6 2e mov r15, r22 digitalWrite(_rs_pin, mode); 3b8: 64 2f mov r22, r20 3ba: 8c 81 ldd r24, Y+4 ; 0x04 3bc: 0e 94 e4 00 call 0x1c8 ; 0x1c8 // if there is a RW pin indicated, set it low to Write if (_rw_pin != 255) { 3c0: 8d 81 ldd r24, Y+5 ; 0x05 3c2: 8f 3f cpi r24, 0xFF ; 255 3c4: 19 f0 breq .+6 ; 0x3cc <_ZN13LiquidCrystal4sendEhh+0x28> digitalWrite(_rw_pin, LOW); 3c6: 60 e0 ldi r22, 0x00 ; 0 3c8: 0e 94 e4 00 call 0x1c8 ; 0x1c8 } if (_displayfunction & LCD_8BITMODE) { 3cc: 8f 85 ldd r24, Y+15 ; 0x0f 3ce: 0f 2d mov r16, r15 3d0: 10 e0 ldi r17, 0x00 ; 0 3d2: 84 ff sbrs r24, 4 3d4: 25 c0 rjmp .+74 ; 0x420 <__LOCK_REGION_LENGTH__+0x20> 3d6: 6e 01 movw r12, r28 3d8: 87 e0 ldi r24, 0x07 ; 7 3da: c8 0e add r12, r24 3dc: d1 1c adc r13, r1 3de: e1 2c mov r14, r1 3e0: f1 2c mov r15, r1 pulseEnable(); } void LiquidCrystal::write8bits(uint8_t value) { for (int i = 0; i < 8; i++) { digitalWrite(_data_pins[i], (value >> i) & 0x01); 3e2: b8 01 movw r22, r16 3e4: 0e 2c mov r0, r14 3e6: 02 c0 rjmp .+4 ; 0x3ec <_ZN13LiquidCrystal4sendEhh+0x48> 3e8: 75 95 asr r23 3ea: 67 95 ror r22 3ec: 0a 94 dec r0 3ee: e2 f7 brpl .-8 ; 0x3e8 <_ZN13LiquidCrystal4sendEhh+0x44> 3f0: 61 70 andi r22, 0x01 ; 1 3f2: f6 01 movw r30, r12 3f4: 81 91 ld r24, Z+ 3f6: 6f 01 movw r12, r30 3f8: 0e 94 e4 00 call 0x1c8 ; 0x1c8 pulseEnable(); } void LiquidCrystal::write8bits(uint8_t value) { for (int i = 0; i < 8; i++) { 3fc: ff ef ldi r31, 0xFF ; 255 3fe: ef 1a sub r14, r31 400: ff 0a sbc r15, r31 402: 88 e0 ldi r24, 0x08 ; 8 404: e8 16 cp r14, r24 406: f1 04 cpc r15, r1 408: 61 f7 brne .-40 ; 0x3e2 <_ZN13LiquidCrystal4sendEhh+0x3e> digitalWrite(_data_pins[i], (value >> i) & 0x01); } pulseEnable(); 40a: ce 01 movw r24, r28 write8bits(value); } else { write4bits(value>>4); write4bits(value); } } 40c: df 91 pop r29 40e: cf 91 pop r28 410: 1f 91 pop r17 412: 0f 91 pop r16 414: ff 90 pop r15 416: ef 90 pop r14 418: df 90 pop r13 41a: cf 90 pop r12 void LiquidCrystal::write8bits(uint8_t value) { for (int i = 0; i < 8; i++) { digitalWrite(_data_pins[i], (value >> i) & 0x01); } pulseEnable(); 41c: 0c 94 8f 01 jmp 0x31e ; 0x31e <_ZN13LiquidCrystal11pulseEnableEv> } if (_displayfunction & LCD_8BITMODE) { write8bits(value); } else { write4bits(value>>4); 420: b8 01 movw r22, r16 422: 84 e0 ldi r24, 0x04 ; 4 424: 75 95 asr r23 426: 67 95 ror r22 428: 8a 95 dec r24 42a: e1 f7 brne .-8 ; 0x424 <__LOCK_REGION_LENGTH__+0x24> 42c: ce 01 movw r24, r28 42e: 0e 94 a5 01 call 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> write4bits(value); 432: 6f 2d mov r22, r15 434: ce 01 movw r24, r28 } } 436: df 91 pop r29 438: cf 91 pop r28 43a: 1f 91 pop r17 43c: 0f 91 pop r16 43e: ff 90 pop r15 440: ef 90 pop r14 442: df 90 pop r13 444: cf 90 pop r12 if (_displayfunction & LCD_8BITMODE) { write8bits(value); } else { write4bits(value>>4); write4bits(value); 446: 0c 94 a5 01 jmp 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> 0000044a <_ZN13LiquidCrystal5writeEh>: inline void LiquidCrystal::command(uint8_t value) { send(value, LOW); } inline size_t LiquidCrystal::write(uint8_t value) { send(value, HIGH); 44a: 41 e0 ldi r20, 0x01 ; 1 44c: 0e 94 d2 01 call 0x3a4 ; 0x3a4 <_ZN13LiquidCrystal4sendEhh> return 1; // assume sucess } 450: 81 e0 ldi r24, 0x01 ; 1 452: 90 e0 ldi r25, 0x00 ; 0 454: 08 95 ret 00000456 <_ZN13LiquidCrystal7commandEh>: } /*********** mid level commands, for sending data/cmds */ inline void LiquidCrystal::command(uint8_t value) { send(value, LOW); 456: 40 e0 ldi r20, 0x00 ; 0 458: 0c 94 d2 01 jmp 0x3a4 ; 0x3a4 <_ZN13LiquidCrystal4sendEhh> 0000045c <_ZN13LiquidCrystal9setCursorEhh.constprop.4>: { command(LCD_RETURNHOME); // set cursor position to zero delayMicroseconds(2000); // this command takes a long time! } void LiquidCrystal::setCursor(uint8_t col, uint8_t row) 45c: 84 30 cpi r24, 0x04 ; 4 45e: 08 f0 brcs .+2 ; 0x462 <_ZN13LiquidCrystal9setCursorEhh.constprop.4+0x6> 460: 83 e0 ldi r24, 0x03 ; 3 { const size_t max_lines = sizeof(_row_offsets) / sizeof(*_row_offsets); if ( row >= max_lines ) { row = max_lines - 1; // we count rows starting w/0 } if ( row >= _numlines ) { 462: 90 91 c8 01 lds r25, 0x01C8 466: 89 17 cp r24, r25 468: 10 f0 brcs .+4 ; 0x46e <_ZN13LiquidCrystal9setCursorEhh.constprop.4+0x12> row = _numlines - 1; // we count rows starting w/0 46a: 8f ef ldi r24, 0xFF ; 255 46c: 89 0f add r24, r25 } command(LCD_SETDDRAMADDR | (col + _row_offsets[row])); 46e: e8 2f mov r30, r24 470: f0 e0 ldi r31, 0x00 ; 0 472: eb 54 subi r30, 0x4B ; 75 474: fe 4f sbci r31, 0xFE ; 254 476: 64 89 ldd r22, Z+20 ; 0x14 478: 60 68 ori r22, 0x80 ; 128 47a: 85 eb ldi r24, 0xB5 ; 181 47c: 91 e0 ldi r25, 0x01 ; 1 47e: 0c 94 2b 02 jmp 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> 00000482 <_ZN13LiquidCrystal5clearEv>: } /********** high level commands, for the user! */ void LiquidCrystal::clear() { command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero 482: 61 e0 ldi r22, 0x01 ; 1 484: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> 488: 8b e3 ldi r24, 0x3B ; 59 48a: 9f e1 ldi r25, 0x1F ; 31 48c: 01 97 sbiw r24, 0x01 ; 1 48e: f1 f7 brne .-4 ; 0x48c <_ZN13LiquidCrystal5clearEv+0xa> 490: 08 95 ret 00000492 <_ZN13LiquidCrystal5beginEhhh.constprop.6>: _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS; begin(16, 1); } void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { 492: ef 92 push r14 494: ff 92 push r15 496: 0f 93 push r16 498: 1f 93 push r17 49a: cf 93 push r28 49c: df 93 push r29 49e: ec 01 movw r28, r24 if (lines > 1) { 4a0: 62 30 cpi r22, 0x02 ; 2 4a2: 18 f0 brcs .+6 ; 0x4aa <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x18> _displayfunction |= LCD_2LINE; 4a4: 8f 85 ldd r24, Y+15 ; 0x0f 4a6: 88 60 ori r24, 0x08 ; 8 4a8: 8f 87 std Y+15, r24 ; 0x0f } _numlines = lines; 4aa: 6b 8b std Y+19, r22 ; 0x13 } void LiquidCrystal::setRowOffsets(int row0, int row1, int row2, int row3) { _row_offsets[0] = row0; 4ac: 1c 8a std Y+20, r1 ; 0x14 _row_offsets[1] = row1; 4ae: 80 e4 ldi r24, 0x40 ; 64 4b0: 8d 8b std Y+21, r24 ; 0x15 _row_offsets[2] = row2; 4b2: 80 e1 ldi r24, 0x10 ; 16 4b4: 8e 8b std Y+22, r24 ; 0x16 _row_offsets[3] = row3; 4b6: 80 e5 ldi r24, 0x50 ; 80 4b8: 8f 8b std Y+23, r24 ; 0x17 // for some 1 line displays you can select a 10 pixel high font if ((dotsize != LCD_5x8DOTS) && (lines == 1)) { _displayfunction |= LCD_5x10DOTS; } pinMode(_rs_pin, OUTPUT); 4ba: 8c 81 ldd r24, Y+4 ; 0x04 4bc: 0e 94 87 00 call 0x10e ; 0x10e // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin# if (_rw_pin != 255) { 4c0: 8d 81 ldd r24, Y+5 ; 0x05 4c2: 8f 3f cpi r24, 0xFF ; 255 4c4: 11 f0 breq .+4 ; 0x4ca <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x38> pinMode(_rw_pin, OUTPUT); 4c6: 0e 94 87 00 call 0x10e ; 0x10e } pinMode(_enable_pin, OUTPUT); 4ca: 8e 81 ldd r24, Y+6 ; 0x06 4cc: 0e 94 87 00 call 0x10e ; 0x10e 4d0: 7e 01 movw r14, r28 4d2: 87 e0 ldi r24, 0x07 ; 7 4d4: e8 0e add r14, r24 4d6: f1 1c adc r15, r1 // Do these once, instead of every time a character is drawn for speed reasons. for (int i=0; i<((_displayfunction & LCD_8BITMODE) ? 8 : 4); ++i) 4d8: 00 e0 ldi r16, 0x00 ; 0 4da: 10 e0 ldi r17, 0x00 ; 0 4dc: 8f 85 ldd r24, Y+15 ; 0x0f 4de: 84 fd sbrc r24, 4 4e0: 03 c0 rjmp .+6 ; 0x4e8 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x56> 4e2: 84 e0 ldi r24, 0x04 ; 4 4e4: 90 e0 ldi r25, 0x00 ; 0 4e6: 02 c0 rjmp .+4 ; 0x4ec <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x5a> 4e8: 88 e0 ldi r24, 0x08 ; 8 4ea: 90 e0 ldi r25, 0x00 ; 0 4ec: 08 17 cp r16, r24 4ee: 19 07 cpc r17, r25 4f0: 44 f4 brge .+16 ; 0x502 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x70> { pinMode(_data_pins[i], OUTPUT); 4f2: f7 01 movw r30, r14 4f4: 81 91 ld r24, Z+ 4f6: 7f 01 movw r14, r30 4f8: 0e 94 87 00 call 0x10e ; 0x10e pinMode(_rw_pin, OUTPUT); } pinMode(_enable_pin, OUTPUT); // Do these once, instead of every time a character is drawn for speed reasons. for (int i=0; i<((_displayfunction & LCD_8BITMODE) ? 8 : 4); ++i) 4fc: 0f 5f subi r16, 0xFF ; 255 4fe: 1f 4f sbci r17, 0xFF ; 255 500: ed cf rjmp .-38 ; 0x4dc <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x4a> 502: 8b e3 ldi r24, 0x3B ; 59 504: 9d e0 ldi r25, 0x0D ; 13 506: 01 97 sbiw r24, 0x01 ; 1 508: f1 f7 brne .-4 ; 0x506 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x74> // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION! // according to datasheet, we need at least 40ms after power rises above 2.7V // before sending commands. Arduino can turn on way before 4.5V so we'll wait 50 delayMicroseconds(50000); // Now we pull both RS and R/W low to begin commands digitalWrite(_rs_pin, LOW); 50a: 60 e0 ldi r22, 0x00 ; 0 50c: 8c 81 ldd r24, Y+4 ; 0x04 50e: 0e 94 e4 00 call 0x1c8 ; 0x1c8 digitalWrite(_enable_pin, LOW); 512: 60 e0 ldi r22, 0x00 ; 0 514: 8e 81 ldd r24, Y+6 ; 0x06 516: 0e 94 e4 00 call 0x1c8 ; 0x1c8 if (_rw_pin != 255) { 51a: 8d 81 ldd r24, Y+5 ; 0x05 51c: 8f 3f cpi r24, 0xFF ; 255 51e: 19 f0 breq .+6 ; 0x526 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x94> digitalWrite(_rw_pin, LOW); 520: 60 e0 ldi r22, 0x00 ; 0 522: 0e 94 e4 00 call 0x1c8 ; 0x1c8 } //put the LCD into 4 bit or 8 bit mode if (! (_displayfunction & LCD_8BITMODE)) { 526: 6f 85 ldd r22, Y+15 ; 0x0f 528: 64 fd sbrc r22, 4 52a: 1d c0 rjmp .+58 ; 0x566 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xd4> // this is according to the hitachi HD44780 datasheet // figure 24, pg 46 // we start in 8bit mode, try to set 4 bit mode write4bits(0x03); 52c: 63 e0 ldi r22, 0x03 ; 3 52e: ce 01 movw r24, r28 530: 0e 94 a5 01 call 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> 534: 0b e4 ldi r16, 0x4B ; 75 536: 16 e4 ldi r17, 0x46 ; 70 538: c8 01 movw r24, r16 53a: 01 97 sbiw r24, 0x01 ; 1 53c: f1 f7 brne .-4 ; 0x53a <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xa8> delayMicroseconds(4500); // wait min 4.1ms // second try write4bits(0x03); 53e: 63 e0 ldi r22, 0x03 ; 3 540: ce 01 movw r24, r28 542: 0e 94 a5 01 call 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> 546: c8 01 movw r24, r16 548: 01 97 sbiw r24, 0x01 ; 1 54a: f1 f7 brne .-4 ; 0x548 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xb6> delayMicroseconds(4500); // wait min 4.1ms // third go! write4bits(0x03); 54c: 63 e0 ldi r22, 0x03 ; 3 54e: ce 01 movw r24, r28 550: 0e 94 a5 01 call 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> 554: 83 e5 ldi r24, 0x53 ; 83 556: 92 e0 ldi r25, 0x02 ; 2 558: 01 97 sbiw r24, 0x01 ; 1 55a: f1 f7 brne .-4 ; 0x558 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xc6> delayMicroseconds(150); // finally, set to 4-bit interface write4bits(0x02); 55c: 62 e0 ldi r22, 0x02 ; 2 55e: ce 01 movw r24, r28 560: 0e 94 a5 01 call 0x34a ; 0x34a <_ZN13LiquidCrystal10write4bitsEh> 564: 16 c0 rjmp .+44 ; 0x592 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0x100> } else { // this is according to the hitachi HD44780 datasheet // page 45 figure 23 // Send function set command sequence command(LCD_FUNCTIONSET | _displayfunction); 566: 60 62 ori r22, 0x20 ; 32 568: ce 01 movw r24, r28 56a: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> 56e: 8b e4 ldi r24, 0x4B ; 75 570: 96 e4 ldi r25, 0x46 ; 70 572: 01 97 sbiw r24, 0x01 ; 1 574: f1 f7 brne .-4 ; 0x572 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xe0> delayMicroseconds(4500); // wait more than 4.1ms // second try command(LCD_FUNCTIONSET | _displayfunction); 576: 6f 85 ldd r22, Y+15 ; 0x0f 578: 60 62 ori r22, 0x20 ; 32 57a: ce 01 movw r24, r28 57c: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> 580: 83 e5 ldi r24, 0x53 ; 83 582: 92 e0 ldi r25, 0x02 ; 2 584: 01 97 sbiw r24, 0x01 ; 1 586: f1 f7 brne .-4 ; 0x584 <_ZN13LiquidCrystal5beginEhhh.constprop.6+0xf2> delayMicroseconds(150); // third go command(LCD_FUNCTIONSET | _displayfunction); 588: 6f 85 ldd r22, Y+15 ; 0x0f 58a: 60 62 ori r22, 0x20 ; 32 58c: ce 01 movw r24, r28 58e: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> } // finally, set # lines, font size, etc. command(LCD_FUNCTIONSET | _displayfunction); 592: 6f 85 ldd r22, Y+15 ; 0x0f 594: 60 62 ori r22, 0x20 ; 32 596: ce 01 movw r24, r28 598: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> // turn the display on with no cursor or blinking default _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; 59c: 84 e0 ldi r24, 0x04 ; 4 59e: 88 8b std Y+16, r24 ; 0x10 _displaycontrol &= ~LCD_DISPLAYON; command(LCD_DISPLAYCONTROL | _displaycontrol); } void LiquidCrystal::display() { _displaycontrol |= LCD_DISPLAYON; command(LCD_DISPLAYCONTROL | _displaycontrol); 5a0: 6c e0 ldi r22, 0x0C ; 12 5a2: ce 01 movw r24, r28 5a4: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> // turn the display on with no cursor or blinking default _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; display(); // clear it off clear(); 5a8: ce 01 movw r24, r28 5aa: 0e 94 41 02 call 0x482 ; 0x482 <_ZN13LiquidCrystal5clearEv> // Initialize to default text direction (for romance languages) _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; 5ae: 82 e0 ldi r24, 0x02 ; 2 5b0: 89 8b std Y+17, r24 ; 0x11 // set the entry mode command(LCD_ENTRYMODESET | _displaymode); 5b2: 66 e0 ldi r22, 0x06 ; 6 5b4: ce 01 movw r24, r28 } 5b6: df 91 pop r29 5b8: cf 91 pop r28 5ba: 1f 91 pop r17 5bc: 0f 91 pop r16 5be: ff 90 pop r15 5c0: ef 90 pop r14 clear(); // Initialize to default text direction (for romance languages) _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; // set the entry mode command(LCD_ENTRYMODESET | _displaymode); 5c2: 0c 94 2b 02 jmp 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> 000005c6 <_ZN5Print5flushEv>: size_t println(unsigned long, int = DEC); size_t println(double, int = 2); size_t println(const Printable&); size_t println(void); virtual void flush() { /* Empty implementation for backward compatibility */ } 5c6: 08 95 ret 000005c8 <_ZN5Print17availableForWriteEv>: return write((const uint8_t *)buffer, size); } // default to zero, meaning "a single write may block" // should be overriden by subclasses with buffering virtual int availableForWrite() { return 0; } 5c8: 80 e0 ldi r24, 0x00 ; 0 5ca: 90 e0 ldi r25, 0x00 ; 0 5cc: 08 95 ret 000005ce <_ZN5Print5printEPKc.constprop.2>: int getWriteError() { return write_error; } void clearWriteError() { setWriteError(0); } virtual size_t write(uint8_t) = 0; size_t write(const char *str) { if (str == NULL) return 0; 5ce: 00 97 sbiw r24, 0x00 ; 0 5d0: 69 f0 breq .+26 ; 0x5ec <_ZN5Print5printEPKc.constprop.2+0x1e> return write((const uint8_t *)str, strlen(str)); 5d2: fc 01 movw r30, r24 5d4: 01 90 ld r0, Z+ 5d6: 00 20 and r0, r0 5d8: e9 f7 brne .-6 ; 0x5d4 <_ZN5Print5printEPKc.constprop.2+0x6> 5da: 31 97 sbiw r30, 0x01 ; 1 5dc: af 01 movw r20, r30 5de: 48 1b sub r20, r24 5e0: 59 0b sbc r21, r25 5e2: bc 01 movw r22, r24 5e4: 85 eb ldi r24, 0xB5 ; 181 5e6: 91 e0 ldi r25, 0x01 ; 1 5e8: 0c 94 b9 00 jmp 0x172 ; 0x172 <_ZN5Print5writeEPKhj> } size_t Print::print(const char str[]) { return write(str); } 5ec: 80 e0 ldi r24, 0x00 ; 0 5ee: 90 e0 ldi r25, 0x00 ; 0 5f0: 08 95 ret 000005f2 <__cxa_pure_virtual>: extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); void __cxa_pure_virtual(void) { // We might want to write some diagnostics to uart in this case //std::terminate(); abort(); 5f2: 0e 94 8c 04 call 0x918 ; 0x918 000005f6 <__vector_16>: #if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) ISR(TIM0_OVF_vect) #else ISR(TIMER0_OVF_vect) #endif { 5f6: 1f 92 push r1 5f8: 0f 92 push r0 5fa: 0f b6 in r0, 0x3f ; 63 5fc: 0f 92 push r0 5fe: 11 24 eor r1, r1 600: 2f 93 push r18 602: 3f 93 push r19 604: 8f 93 push r24 606: 9f 93 push r25 608: af 93 push r26 60a: bf 93 push r27 // copy these to local variables so they can be stored in registers // (volatile variables must be read from memory on every access) unsigned long m = timer0_millis; 60c: 80 91 ab 01 lds r24, 0x01AB 610: 90 91 ac 01 lds r25, 0x01AC 614: a0 91 ad 01 lds r26, 0x01AD 618: b0 91 ae 01 lds r27, 0x01AE unsigned char f = timer0_fract; 61c: 30 91 aa 01 lds r19, 0x01AA m += MILLIS_INC; f += FRACT_INC; 620: 23 e0 ldi r18, 0x03 ; 3 622: 23 0f add r18, r19 if (f >= FRACT_MAX) { 624: 2d 37 cpi r18, 0x7D ; 125 626: 20 f4 brcc .+8 ; 0x630 <__vector_16+0x3a> // copy these to local variables so they can be stored in registers // (volatile variables must be read from memory on every access) unsigned long m = timer0_millis; unsigned char f = timer0_fract; m += MILLIS_INC; 628: 01 96 adiw r24, 0x01 ; 1 62a: a1 1d adc r26, r1 62c: b1 1d adc r27, r1 62e: 05 c0 rjmp .+10 ; 0x63a <__vector_16+0x44> f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 630: 26 e8 ldi r18, 0x86 ; 134 632: 23 0f add r18, r19 m += 1; 634: 02 96 adiw r24, 0x02 ; 2 636: a1 1d adc r26, r1 638: b1 1d adc r27, r1 } timer0_fract = f; 63a: 20 93 aa 01 sts 0x01AA, r18 timer0_millis = m; 63e: 80 93 ab 01 sts 0x01AB, r24 642: 90 93 ac 01 sts 0x01AC, r25 646: a0 93 ad 01 sts 0x01AD, r26 64a: b0 93 ae 01 sts 0x01AE, r27 timer0_overflow_count++; 64e: 80 91 af 01 lds r24, 0x01AF 652: 90 91 b0 01 lds r25, 0x01B0 656: a0 91 b1 01 lds r26, 0x01B1 65a: b0 91 b2 01 lds r27, 0x01B2 65e: 01 96 adiw r24, 0x01 ; 1 660: a1 1d adc r26, r1 662: b1 1d adc r27, r1 664: 80 93 af 01 sts 0x01AF, r24 668: 90 93 b0 01 sts 0x01B0, r25 66c: a0 93 b1 01 sts 0x01B1, r26 670: b0 93 b2 01 sts 0x01B2, r27 } 674: bf 91 pop r27 676: af 91 pop r26 678: 9f 91 pop r25 67a: 8f 91 pop r24 67c: 3f 91 pop r19 67e: 2f 91 pop r18 680: 0f 90 pop r0 682: 0f be out 0x3f, r0 ; 63 684: 0f 90 pop r0 686: 1f 90 pop r1 688: 18 95 reti 0000068a
: void init() { // this needs to be called before setup() or some functions won't // work there sei(); 68a: 78 94 sei // on the ATmega168, timer 0 is also used for fast hardware pwm // (using phase-correct PWM would mean that timer 0 overflowed half as often // resulting in different millis() behavior on the ATmega8 and ATmega168) #if defined(TCCR0A) && defined(WGM01) sbi(TCCR0A, WGM01); 68c: 84 b5 in r24, 0x24 ; 36 68e: 82 60 ori r24, 0x02 ; 2 690: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 692: 84 b5 in r24, 0x24 ; 36 694: 81 60 ori r24, 0x01 ; 1 696: 84 bd out 0x24, r24 ; 36 // this combination is for the standard atmega8 sbi(TCCR0, CS01); sbi(TCCR0, CS00); #elif defined(TCCR0B) && defined(CS01) && defined(CS00) // this combination is for the standard 168/328/1280/2560 sbi(TCCR0B, CS01); 698: 85 b5 in r24, 0x25 ; 37 69a: 82 60 ori r24, 0x02 ; 2 69c: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 69e: 85 b5 in r24, 0x25 ; 37 6a0: 81 60 ori r24, 0x01 ; 1 6a2: 85 bd out 0x25, r24 ; 37 // enable timer 0 overflow interrupt #if defined(TIMSK) && defined(TOIE0) sbi(TIMSK, TOIE0); #elif defined(TIMSK0) && defined(TOIE0) sbi(TIMSK0, TOIE0); 6a4: 80 91 6e 00 lds r24, 0x006E 6a8: 81 60 ori r24, 0x01 ; 1 6aa: 80 93 6e 00 sts 0x006E, r24 // this is better for motors as it ensures an even waveform // note, however, that fast pwm mode can achieve a frequency of up // 8 MHz (with a 16 MHz clock) at 50% duty cycle #if defined(TCCR1B) && defined(CS11) && defined(CS10) TCCR1B = 0; 6ae: 10 92 81 00 sts 0x0081, r1 // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 6b2: 80 91 81 00 lds r24, 0x0081 6b6: 82 60 ori r24, 0x02 ; 2 6b8: 80 93 81 00 sts 0x0081, r24 #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 6bc: 80 91 81 00 lds r24, 0x0081 6c0: 81 60 ori r24, 0x01 ; 1 6c2: 80 93 81 00 sts 0x0081, r24 sbi(TCCR1, CS10); #endif #endif // put timer 1 in 8-bit phase correct pwm mode #if defined(TCCR1A) && defined(WGM10) sbi(TCCR1A, WGM10); 6c6: 80 91 80 00 lds r24, 0x0080 6ca: 81 60 ori r24, 0x01 ; 1 6cc: 80 93 80 00 sts 0x0080, r24 // set timer 2 prescale factor to 64 #if defined(TCCR2) && defined(CS22) sbi(TCCR2, CS22); #elif defined(TCCR2B) && defined(CS22) sbi(TCCR2B, CS22); 6d0: 80 91 b1 00 lds r24, 0x00B1 6d4: 84 60 ori r24, 0x04 ; 4 6d6: 80 93 b1 00 sts 0x00B1, r24 // configure timer 2 for phase correct pwm (8-bit) #if defined(TCCR2) && defined(WGM20) sbi(TCCR2, WGM20); #elif defined(TCCR2A) && defined(WGM20) sbi(TCCR2A, WGM20); 6da: 80 91 b0 00 lds r24, 0x00B0 6de: 81 60 ori r24, 0x01 ; 1 6e0: 80 93 b0 00 sts 0x00B0, r24 #endif #if defined(ADCSRA) // set a2d prescaler so we are inside the desired 50-200 KHz range. #if F_CPU >= 16000000 // 16 MHz / 128 = 125 KHz sbi(ADCSRA, ADPS2); 6e4: 80 91 7a 00 lds r24, 0x007A 6e8: 84 60 ori r24, 0x04 ; 4 6ea: 80 93 7a 00 sts 0x007A, r24 sbi(ADCSRA, ADPS1); 6ee: 80 91 7a 00 lds r24, 0x007A 6f2: 82 60 ori r24, 0x02 ; 2 6f4: 80 93 7a 00 sts 0x007A, r24 sbi(ADCSRA, ADPS0); 6f8: 80 91 7a 00 lds r24, 0x007A 6fc: 81 60 ori r24, 0x01 ; 1 6fe: 80 93 7a 00 sts 0x007A, r24 cbi(ADCSRA, ADPS2); cbi(ADCSRA, ADPS1); sbi(ADCSRA, ADPS0); #endif // enable a2d conversions sbi(ADCSRA, ADEN); 702: 80 91 7a 00 lds r24, 0x007A 706: 80 68 ori r24, 0x80 ; 128 708: 80 93 7a 00 sts 0x007A, r24 // here so they can be used as normal digital i/o; they will be // reconnected in Serial.begin() #if defined(UCSRB) UCSRB = 0; #elif defined(UCSR0B) UCSR0B = 0; 70c: 10 92 c1 00 sts 0x00C1, r1 int key=-1; int oldkey=-1; void setup() { lcd.begin(16, 2); 710: 62 e0 ldi r22, 0x02 ; 2 712: 85 eb ldi r24, 0xB5 ; 181 714: 91 e0 ldi r25, 0x01 ; 1 716: 0e 94 49 02 call 0x492 ; 0x492 <_ZN13LiquidCrystal5beginEhhh.constprop.6> lcd.clear(); 71a: 85 eb ldi r24, 0xB5 ; 181 71c: 91 e0 ldi r25, 0x01 ; 1 71e: 0e 94 41 02 call 0x482 ; 0x482 <_ZN13LiquidCrystal5clearEv> lcd.setCursor(0,0); 722: 80 e0 ldi r24, 0x00 ; 0 724: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> lcd.print(" hello! "); 728: 80 e6 ldi r24, 0x60 ; 96 72a: 91 e0 ldi r25, 0x01 ; 1 72c: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> lcd.print(" welcome!"); 730: 8d e6 ldi r24, 0x6D ; 109 732: 91 e0 ldi r25, 0x01 ; 1 734: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> lcd.setCursor(0,1); 738: 81 e0 ldi r24, 0x01 ; 1 73a: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> lcd.print(" LinkSprite"); 73e: 8c e7 ldi r24, 0x7C ; 124 740: 91 e0 ldi r25, 0x01 ; 1 742: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> lcd.print(" LCD Shield"); 746: 8a e8 ldi r24, 0x8A ; 138 748: 91 e0 ldi r25, 0x01 ; 1 74a: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> delay(1000); 74e: 68 ee ldi r22, 0xE8 ; 232 750: 73 e0 ldi r23, 0x03 ; 3 752: 80 e0 ldi r24, 0x00 ; 0 754: 90 e0 ldi r25, 0x00 ; 0 756: 0e 94 55 01 call 0x2aa ; 0x2aa lcd.setCursor(0,0); 75a: 80 e0 ldi r24, 0x00 ; 0 75c: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> 760: ca e1 ldi r28, 0x1A ; 26 command(LCD_DISPLAYCONTROL | _displaycontrol); } // These commands scroll the display without changing the RAM void LiquidCrystal::scrollDisplayLeft(void) { command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT); 762: 68 e1 ldi r22, 0x18 ; 24 764: 85 eb ldi r24, 0xB5 ; 181 766: 91 e0 ldi r25, 0x01 ; 1 768: 0e 94 2b 02 call 0x456 ; 0x456 <_ZN13LiquidCrystal7commandEh> for (char k=0;k<26;k++) { lcd.scrollDisplayLeft(); delay(400); 76c: 60 e9 ldi r22, 0x90 ; 144 76e: 71 e0 ldi r23, 0x01 ; 1 770: 80 e0 ldi r24, 0x00 ; 0 772: 90 e0 ldi r25, 0x00 ; 0 774: 0e 94 55 01 call 0x2aa ; 0x2aa 778: c1 50 subi r28, 0x01 ; 1 lcd.print(" LinkSprite"); lcd.print(" LCD Shield"); delay(1000); lcd.setCursor(0,0); for (char k=0;k<26;k++) 77a: 99 f7 brne .-26 ; 0x762 { lcd.scrollDisplayLeft(); delay(400); } lcd.clear(); 77c: 85 eb ldi r24, 0xB5 ; 181 77e: 91 e0 ldi r25, 0x01 ; 1 780: 0e 94 41 02 call 0x482 ; 0x482 <_ZN13LiquidCrystal5clearEv> lcd.setCursor(0,0); 784: 80 e0 ldi r24, 0x00 ; 0 786: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> lcd.print("ADC key testing"); 78a: 89 e9 ldi r24, 0x99 ; 153 78c: 91 e0 ldi r25, 0x01 ; 1 78e: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> lcd.setCursor(0, 1); 792: 81 e0 ldi r24, 0x01 ; 1 794: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 798: 00 e0 ldi r16, 0x00 ; 0 79a: 10 e0 ldi r17, 0x00 ; 0 } void loop() { adc_key_in = analogRead(0); // read the value from the sensor 79c: 0e 94 a6 00 call 0x14c ; 0x14c 7a0: 90 93 b4 01 sts 0x01B4, r25 7a4: 80 93 b3 01 sts 0x01B3, r24 int get_key(unsigned int input) { int k; for (k = 0; k < NUM_KEYS; k++) { if (input < adc_key_val[k]) 7a8: 86 37 cpi r24, 0x76 ; 118 7aa: 22 e0 ldi r18, 0x02 ; 2 7ac: 92 07 cpc r25, r18 7ae: 90 f0 brcs .+36 ; 0x7d4 7b0: 84 33 cpi r24, 0x34 ; 52 7b2: 23 e0 ldi r18, 0x03 ; 3 7b4: 92 07 cpc r25, r18 7b6: 88 f0 brcs .+34 ; 0x7da 7b8: 86 36 cpi r24, 0x66 ; 102 7ba: 23 e0 ldi r18, 0x03 ; 3 7bc: 92 07 cpc r25, r18 7be: 80 f0 brcs .+32 ; 0x7e0 7c0: 8e 38 cpi r24, 0x8E ; 142 7c2: 23 e0 ldi r18, 0x03 ; 3 7c4: 92 07 cpc r25, r18 7c6: 78 f0 brcs .+30 ; 0x7e6 7c8: 86 3b cpi r24, 0xB6 ; 182 7ca: 93 40 sbci r25, 0x03 ; 3 7cc: 78 f4 brcc .+30 ; 0x7ec } // Convert ADC value to key number int get_key(unsigned int input) { int k; for (k = 0; k < NUM_KEYS; k++) 7ce: 84 e0 ldi r24, 0x04 ; 4 7d0: 90 e0 ldi r25, 0x00 ; 0 7d2: 0e c0 rjmp .+28 ; 0x7f0 7d4: 80 e0 ldi r24, 0x00 ; 0 7d6: 90 e0 ldi r25, 0x00 ; 0 7d8: 0b c0 rjmp .+22 ; 0x7f0 7da: 81 e0 ldi r24, 0x01 ; 1 7dc: 90 e0 ldi r25, 0x00 ; 0 7de: 08 c0 rjmp .+16 ; 0x7f0 7e0: 82 e0 ldi r24, 0x02 ; 2 7e2: 90 e0 ldi r25, 0x00 ; 0 7e4: 05 c0 rjmp .+10 ; 0x7f0 7e6: 83 e0 ldi r24, 0x03 ; 3 7e8: 90 e0 ldi r25, 0x00 ; 0 7ea: 02 c0 rjmp .+4 ; 0x7f0 if (input < adc_key_val[k]) { return k; } } if (k >= NUM_KEYS)k = -1; // No valid key pressed 7ec: 8f ef ldi r24, 0xFF ; 255 7ee: 9f ef ldi r25, 0xFF ; 255 lcd.setCursor(0, 1); } void loop() { adc_key_in = analogRead(0); // read the value from the sensor key = get_key(adc_key_in); // convert into key press 7f0: 90 93 53 01 sts 0x0153, r25 7f4: 80 93 52 01 sts 0x0152, r24 if (key != oldkey) // if keypress is detected 7f8: 20 91 50 01 lds r18, 0x0150 7fc: 30 91 51 01 lds r19, 0x0151 800: 82 17 cp r24, r18 802: 93 07 cpc r25, r19 804: 09 f4 brne .+2 ; 0x808 806: 56 c0 rjmp .+172 ; 0x8b4 { delay(50); // wait for debounce time 808: 62 e3 ldi r22, 0x32 ; 50 80a: 70 e0 ldi r23, 0x00 ; 0 80c: 80 e0 ldi r24, 0x00 ; 0 80e: 90 e0 ldi r25, 0x00 ; 0 810: 0e 94 55 01 call 0x2aa ; 0x2aa adc_key_in = analogRead(0); // read the value from the sensor 814: 0e 94 a6 00 call 0x14c ; 0x14c 818: 90 93 b4 01 sts 0x01B4, r25 81c: 80 93 b3 01 sts 0x01B3, r24 lcd.print("!"); 820: 8a e7 ldi r24, 0x7A ; 122 822: 91 e0 ldi r25, 0x01 ; 1 824: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> key = get_key(adc_key_in); // convert into key press 828: 80 91 b3 01 lds r24, 0x01B3 82c: 90 91 b4 01 lds r25, 0x01B4 int get_key(unsigned int input) { int k; for (k = 0; k < NUM_KEYS; k++) { if (input < adc_key_val[k]) 830: 86 37 cpi r24, 0x76 ; 118 832: 22 e0 ldi r18, 0x02 ; 2 834: 92 07 cpc r25, r18 836: 90 f0 brcs .+36 ; 0x85c 838: 84 33 cpi r24, 0x34 ; 52 83a: 23 e0 ldi r18, 0x03 ; 3 83c: 92 07 cpc r25, r18 83e: 88 f0 brcs .+34 ; 0x862 840: 86 36 cpi r24, 0x66 ; 102 842: 23 e0 ldi r18, 0x03 ; 3 844: 92 07 cpc r25, r18 846: 80 f0 brcs .+32 ; 0x868 848: 8e 38 cpi r24, 0x8E ; 142 84a: 23 e0 ldi r18, 0x03 ; 3 84c: 92 07 cpc r25, r18 84e: 78 f0 brcs .+30 ; 0x86e 850: 86 3b cpi r24, 0xB6 ; 182 852: 93 40 sbci r25, 0x03 ; 3 854: 78 f4 brcc .+30 ; 0x874 } // Convert ADC value to key number int get_key(unsigned int input) { int k; for (k = 0; k < NUM_KEYS; k++) 856: c4 e0 ldi r28, 0x04 ; 4 858: d0 e0 ldi r29, 0x00 ; 0 85a: 0e c0 rjmp .+28 ; 0x878 85c: c0 e0 ldi r28, 0x00 ; 0 85e: d0 e0 ldi r29, 0x00 ; 0 860: 0b c0 rjmp .+22 ; 0x878 862: c1 e0 ldi r28, 0x01 ; 1 864: d0 e0 ldi r29, 0x00 ; 0 866: 08 c0 rjmp .+16 ; 0x878 868: c2 e0 ldi r28, 0x02 ; 2 86a: d0 e0 ldi r29, 0x00 ; 0 86c: 05 c0 rjmp .+10 ; 0x878 86e: c3 e0 ldi r28, 0x03 ; 3 870: d0 e0 ldi r29, 0x00 ; 0 872: 02 c0 rjmp .+4 ; 0x878 if (input < adc_key_val[k]) { return k; } } if (k >= NUM_KEYS)k = -1; // No valid key pressed 874: cf ef ldi r28, 0xFF ; 255 876: df ef ldi r29, 0xFF ; 255 if (key != oldkey) // if keypress is detected { delay(50); // wait for debounce time adc_key_in = analogRead(0); // read the value from the sensor lcd.print("!"); key = get_key(adc_key_in); // convert into key press 878: d0 93 53 01 sts 0x0153, r29 87c: c0 93 52 01 sts 0x0152, r28 if (key != oldkey) 880: 80 91 50 01 lds r24, 0x0150 884: 90 91 51 01 lds r25, 0x0151 888: c8 17 cp r28, r24 88a: d9 07 cpc r29, r25 88c: 99 f0 breq .+38 ; 0x8b4 { lcd.setCursor(0, 1); 88e: 81 e0 ldi r24, 0x01 ; 1 890: 0e 94 2e 02 call 0x45c ; 0x45c <_ZN13LiquidCrystal9setCursorEhh.constprop.4> oldkey = key; 894: d0 93 51 01 sts 0x0151, r29 898: c0 93 50 01 sts 0x0150, r28 if (key >=0) 89c: d7 fd sbrc r29, 7 89e: 0a c0 rjmp .+20 ; 0x8b4 { lcd.print(msgs[key]); 8a0: ce 01 movw r24, r28 8a2: 24 e0 ldi r18, 0x04 ; 4 8a4: 88 0f add r24, r24 8a6: 99 1f adc r25, r25 8a8: 2a 95 dec r18 8aa: e1 f7 brne .-8 ; 0x8a4 8ac: 80 50 subi r24, 0x00 ; 0 8ae: 9f 4f sbci r25, 0xFF ; 255 8b0: 0e 94 e7 02 call 0x5ce ; 0x5ce <_ZN5Print5printEPKc.constprop.2> //lcd.print(adc_key_in); } } } delay(100); 8b4: 64 e6 ldi r22, 0x64 ; 100 8b6: 70 e0 ldi r23, 0x00 ; 0 8b8: 80 e0 ldi r24, 0x00 ; 0 8ba: 90 e0 ldi r25, 0x00 ; 0 8bc: 0e 94 55 01 call 0x2aa ; 0x2aa 8c0: 01 15 cp r16, r1 8c2: 11 05 cpc r17, r1 8c4: 09 f4 brne .+2 ; 0x8c8 8c6: 6a cf rjmp .-300 ; 0x79c 8c8: 0e 94 00 00 call 0 ; 0x0 <__vectors> 8cc: 67 cf rjmp .-306 ; 0x79c 000008ce <_GLOBAL__sub_I_lcd>: size_t printNumber(unsigned long, uint8_t); size_t printFloat(double, uint8_t); protected: void setWriteError(int err = 1) { write_error = err; } public: Print() : write_error(0) {} 8ce: e5 eb ldi r30, 0xB5 ; 181 8d0: f1 e0 ldi r31, 0x01 ; 1 8d2: 13 82 std Z+3, r1 ; 0x03 8d4: 12 82 std Z+2, r1 ; 0x02 { init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0); } LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) 8d6: 88 e5 ldi r24, 0x58 ; 88 8d8: 91 e0 ldi r25, 0x01 ; 1 8da: 91 83 std Z+1, r25 ; 0x01 8dc: 80 83 st Z, r24 void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) { _rs_pin = rs; 8de: 88 e0 ldi r24, 0x08 ; 8 8e0: 84 83 std Z+4, r24 ; 0x04 _rw_pin = rw; 8e2: 8f ef ldi r24, 0xFF ; 255 8e4: 85 83 std Z+5, r24 ; 0x05 _enable_pin = enable; 8e6: 89 e0 ldi r24, 0x09 ; 9 8e8: 86 83 std Z+6, r24 ; 0x06 _data_pins[0] = d0; 8ea: 84 e0 ldi r24, 0x04 ; 4 8ec: 87 83 std Z+7, r24 ; 0x07 _data_pins[1] = d1; 8ee: 85 e0 ldi r24, 0x05 ; 5 8f0: 80 87 std Z+8, r24 ; 0x08 _data_pins[2] = d2; 8f2: 86 e0 ldi r24, 0x06 ; 6 8f4: 81 87 std Z+9, r24 ; 0x09 _data_pins[3] = d3; 8f6: 87 e0 ldi r24, 0x07 ; 7 8f8: 82 87 std Z+10, r24 ; 0x0a _data_pins[4] = d4; 8fa: 13 86 std Z+11, r1 ; 0x0b _data_pins[5] = d5; 8fc: 14 86 std Z+12, r1 ; 0x0c _data_pins[6] = d6; 8fe: 15 86 std Z+13, r1 ; 0x0d _data_pins[7] = d7; 900: 16 86 std Z+14, r1 ; 0x0e if (fourbitmode) _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS; 902: 17 86 std Z+15, r1 ; 0x0f else _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS; begin(16, 1); 904: 61 e0 ldi r22, 0x01 ; 1 906: cf 01 movw r24, r30 908: 0c 94 49 02 jmp 0x492 ; 0x492 <_ZN13LiquidCrystal5beginEhhh.constprop.6> 0000090c <__tablejump2__>: 90c: ee 0f add r30, r30 90e: ff 1f adc r31, r31 910: 05 90 lpm r0, Z+ 912: f4 91 lpm r31, Z 914: e0 2d mov r30, r0 916: 09 94 ijmp 00000918 : 918: 81 e0 ldi r24, 0x01 ; 1 91a: 90 e0 ldi r25, 0x00 ; 0 91c: f8 94 cli 91e: 0c 94 91 04 jmp 0x922 ; 0x922 <_exit> 00000922 <_exit>: 922: f8 94 cli 00000924 <__stop_program>: 924: ff cf rjmp .-2 ; 0x924 <__stop_program>