Arduino Night Light

From BenningtonWiki
Jump to: navigation, search

Connect a phototransistor to analog input 0 and an LED to digital output 13. The LED comes on when the phototransistor reads a low light level.

<source lang="C"> void setup(void) {

   pinMode(13, OUTPUT);

}

void loop(void) {

   int light_level;
   light_level = analogRead(0);
   if (light_level < 200)
       digitalWrite(13, 1);
   else
       digitalWrite(13, 0);

} </source>

<source lang="text"> /Applications/arduino-0011/hardware/tools/avr/bin/avr-objdump -d ~/Documents/Arduino/sketch_081208a/applet/sketch_081208a.elf > ~/Desktop/night-light.txt /Users/joe/Documents/Arduino/sketch_081208a/applet/sketch_081208a.elf: file format elf32-avr

Disassembly of section .text:

00000000 <__vectors>:

  0:	0c 94 5a 00 	jmp	0xb4 <__init>
  4:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
  8:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
  c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 10:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 14:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 18:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 1c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 20:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 24:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 28:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 2c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 30:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 34:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 38:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 3c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 40:	0c 94 94 00 	jmp	0x128 <__vector_16>
 44:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 48:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 4c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 50:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 54:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 58:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 5c:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 60:	0c 94 75 00 	jmp	0xea <__bad_interrupt>
 64:	0c 94 75 00 	jmp	0xea <__bad_interrupt>

00000068 <__ctors_end>:

 68:	00 00       	nop
 6a:	00 07       	cpc	r16, r16
 6c:	00 02       	muls	r16, r16
 6e:	01 00       	.word	0x0001	; ????
 70:	00 03       	mulsu	r16, r16
 72:	04 06       	cpc	r0, r20

...

0000007c <digital_pin_to_bit_mask_PGM>:

 7c:	01 02 04 08 10 20 40 80 01 02 04 08 10 20 01 02     ..... @...... ..
 8c:	04 08 10 20                                         ... 

00000090 <digital_pin_to_port_PGM>:

 90:	04 04 04 04 04 04 04 04 02 02 02 02 02 02 03 03     ................
 a0:	03 03 03 03                                         ....

000000a4 <port_to_input_PGM>:

 a4:	00 00 23 26 29                                      ..#&)

000000a9 <port_to_output_PGM>:

 a9:	00 00 25 28 2b                                      ..%(+

000000ae <port_to_mode_PGM>:

 ae:	00 00 24 27 2a 00                                   ..$'*.

000000b4 <__init>:

 b4:	11 24       	eor	r1, r1
 b6:	1f be       	out	0x3f, r1	; 63
 b8:	cf ef       	ldi	r28, 0xFF	; 255
 ba:	d4 e0       	ldi	r29, 0x04	; 4
 bc:	de bf       	out	0x3e, r29	; 62
 be:	cd bf       	out	0x3d, r28	; 61

000000c0 <__do_copy_data>:

 c0:	11 e0       	ldi	r17, 0x01	; 1
 c2:	a0 e0       	ldi	r26, 0x00	; 0
 c4:	b1 e0       	ldi	r27, 0x01	; 1
 c6:	e6 e1       	ldi	r30, 0x16	; 22
 c8:	f5 e0       	ldi	r31, 0x05	; 5
 ca:	02 c0       	rjmp	.+4      	; 0xd0 <.do_copy_data_start>

000000cc <.do_copy_data_loop>:

 cc:	05 90       	lpm	r0, Z+
 ce:	0d 92       	st	X+, r0

000000d0 <.do_copy_data_start>:

 d0:	a2 30       	cpi	r26, 0x02	; 2
 d2:	b1 07       	cpc	r27, r17
 d4:	d9 f7       	brne	.-10     	; 0xcc <.do_copy_data_loop>

000000d6 <__do_clear_bss>:

 d6:	11 e0       	ldi	r17, 0x01	; 1
 d8:	a2 e0       	ldi	r26, 0x02	; 2
 da:	b1 e0       	ldi	r27, 0x01	; 1
 dc:	01 c0       	rjmp	.+2      	; 0xe0 <.do_clear_bss_start>

000000de <.do_clear_bss_loop>:

 de:	1d 92       	st	X+, r1

000000e0 <.do_clear_bss_start>:

 e0:	a6 30       	cpi	r26, 0x06	; 6
 e2:	b1 07       	cpc	r27, r17
 e4:	e1 f7       	brne	.-8      	; 0xde <.do_clear_bss_loop>
 e6:	0c 94 89 00 	jmp	0x112 <main>

000000ea <__bad_interrupt>:

 ea:	0c 94 00 00 	jmp	0x0 <__heap_end>

000000ee <setup>:

 ee:	61 e0       	ldi	r22, 0x01	; 1
 f0:	8d e0       	ldi	r24, 0x0D	; 13
 f2:	0e 94 b7 01 	call	0x36e <pinMode>
 f6:	08 95       	ret

000000f8 <loop>:

 f8:	80 e0       	ldi	r24, 0x00	; 0
 fa:	0e 94 45 01 	call	0x28a <analogRead>
 fe:	88 3c       	cpi	r24, 0xC8	; 200
100:	91 05       	cpc	r25, r1
102:	14 f4       	brge	.+4      	; 0x108 <loop+0x10>
104:	61 e0       	ldi	r22, 0x01	; 1
106:	01 c0       	rjmp	.+2      	; 0x10a <loop+0x12>
108:	60 e0       	ldi	r22, 0x00	; 0
10a:	8d e0       	ldi	r24, 0x0D	; 13
10c:	0e 94 1e 02 	call	0x43c <digitalWrite>
110:	08 95       	ret

00000112 <main>:

112:	cf ef       	ldi	r28, 0xFF	; 255
114:	d4 e0       	ldi	r29, 0x04	; 4
116:	de bf       	out	0x3e, r29	; 62
118:	cd bf       	out	0x3d, r28	; 61
11a:	0e 94 00 01 	call	0x200 <init>
11e:	0e 94 77 00 	call	0xee <setup>
122:	0e 94 7c 00 	call	0xf8 <loop>
126:	fd cf       	rjmp	.-6      	; 0x122 <main+0x10>

00000128 <__vector_16>:

128:	1f 92       	push	r1
12a:	0f 92       	push	r0
12c:	0f b6       	in	r0, 0x3f	; 63
12e:	0f 92       	push	r0
130:	11 24       	eor	r1, r1
132:	8f 93       	push	r24
134:	9f 93       	push	r25
136:	af 93       	push	r26
138:	bf 93       	push	r27
13a:	80 91 02 01 	lds	r24, 0x0102
13e:	90 91 03 01 	lds	r25, 0x0103
142:	a0 91 04 01 	lds	r26, 0x0104
146:	b0 91 05 01 	lds	r27, 0x0105
14a:	01 96       	adiw	r24, 0x01	; 1
14c:	a1 1d       	adc	r26, r1
14e:	b1 1d       	adc	r27, r1
150:	80 93 02 01 	sts	0x0102, r24
154:	90 93 03 01 	sts	0x0103, r25
158:	a0 93 04 01 	sts	0x0104, r26
15c:	b0 93 05 01 	sts	0x0105, r27
160:	bf 91       	pop	r27
162:	af 91       	pop	r26
164:	9f 91       	pop	r25
166:	8f 91       	pop	r24
168:	0f 90       	pop	r0
16a:	0f be       	out	0x3f, r0	; 63
16c:	0f 90       	pop	r0
16e:	1f 90       	pop	r1
170:	18 95       	reti

00000172 <millis>:

172:	60 91 02 01 	lds	r22, 0x0102
176:	70 91 03 01 	lds	r23, 0x0103
17a:	80 91 04 01 	lds	r24, 0x0104
17e:	90 91 05 01 	lds	r25, 0x0105
182:	27 e0       	ldi	r18, 0x07	; 7
184:	66 0f       	add	r22, r22
186:	77 1f       	adc	r23, r23
188:	88 1f       	adc	r24, r24
18a:	99 1f       	adc	r25, r25
18c:	2a 95       	dec	r18
18e:	d1 f7       	brne	.-12     	; 0x184 <millis+0x12>
190:	2d e7       	ldi	r18, 0x7D	; 125
192:	30 e0       	ldi	r19, 0x00	; 0
194:	40 e0       	ldi	r20, 0x00	; 0
196:	50 e0       	ldi	r21, 0x00	; 0
198:	0e 94 69 02 	call	0x4d2 <__udivmodsi4>
19c:	ca 01       	movw	r24, r20
19e:	b9 01       	movw	r22, r18
1a0:	08 95       	ret

000001a2 <delay>:

1a2:	af 92       	push	r10
1a4:	bf 92       	push	r11
1a6:	cf 92       	push	r12
1a8:	df 92       	push	r13
1aa:	ef 92       	push	r14
1ac:	ff 92       	push	r15
1ae:	0f 93       	push	r16
1b0:	1f 93       	push	r17
1b2:	5b 01       	movw	r10, r22
1b4:	6c 01       	movw	r12, r24
1b6:	0e 94 b9 00 	call	0x172 <millis>
1ba:	7b 01       	movw	r14, r22
1bc:	8c 01       	movw	r16, r24
1be:	0e 94 b9 00 	call	0x172 <millis>
1c2:	6e 19       	sub	r22, r14
1c4:	7f 09       	sbc	r23, r15
1c6:	80 0b       	sbc	r24, r16
1c8:	91 0b       	sbc	r25, r17
1ca:	6a 15       	cp	r22, r10
1cc:	7b 05       	cpc	r23, r11
1ce:	8c 05       	cpc	r24, r12
1d0:	9d 05       	cpc	r25, r13
1d2:	a8 f3       	brcs	.-22     	; 0x1be <delay+0x1c>
1d4:	1f 91       	pop	r17
1d6:	0f 91       	pop	r16
1d8:	ff 90       	pop	r15
1da:	ef 90       	pop	r14
1dc:	df 90       	pop	r13
1de:	cf 90       	pop	r12
1e0:	bf 90       	pop	r11
1e2:	af 90       	pop	r10
1e4:	08 95       	ret

000001e6 <delayMicroseconds>:

1e6:	01 97       	sbiw	r24, 0x01	; 1
1e8:	51 f0       	breq	.+20     	; 0x1fe <delayMicroseconds+0x18>
1ea:	88 0f       	add	r24, r24
1ec:	99 1f       	adc	r25, r25
1ee:	88 0f       	add	r24, r24
1f0:	99 1f       	adc	r25, r25
1f2:	02 97       	sbiw	r24, 0x02	; 2
1f4:	2f b7       	in	r18, 0x3f	; 63
1f6:	f8 94       	cli
1f8:	01 97       	sbiw	r24, 0x01	; 1
1fa:	f1 f7       	brne	.-4      	; 0x1f8 <delayMicroseconds+0x12>
1fc:	2f bf       	out	0x3f, r18	; 63
1fe:	08 95       	ret

00000200 <init>:

200:	78 94       	sei
202:	10 92 02 01 	sts	0x0102, r1
206:	10 92 03 01 	sts	0x0103, r1
20a:	10 92 04 01 	sts	0x0104, r1
20e:	10 92 05 01 	sts	0x0105, r1
212:	84 b5       	in	r24, 0x24	; 36
214:	82 60       	ori	r24, 0x02	; 2
216:	84 bd       	out	0x24, r24	; 36
218:	84 b5       	in	r24, 0x24	; 36
21a:	81 60       	ori	r24, 0x01	; 1
21c:	84 bd       	out	0x24, r24	; 36
21e:	85 b5       	in	r24, 0x25	; 37
220:	82 60       	ori	r24, 0x02	; 2
222:	85 bd       	out	0x25, r24	; 37
224:	85 b5       	in	r24, 0x25	; 37
226:	81 60       	ori	r24, 0x01	; 1
228:	85 bd       	out	0x25, r24	; 37
22a:	ee e6       	ldi	r30, 0x6E	; 110
22c:	f0 e0       	ldi	r31, 0x00	; 0
22e:	80 81       	ld	r24, Z
230:	81 60       	ori	r24, 0x01	; 1
232:	80 83       	st	Z, r24
234:	e1 e8       	ldi	r30, 0x81	; 129
236:	f0 e0       	ldi	r31, 0x00	; 0
238:	80 81       	ld	r24, Z
23a:	82 60       	ori	r24, 0x02	; 2
23c:	80 83       	st	Z, r24
23e:	80 81       	ld	r24, Z
240:	81 60       	ori	r24, 0x01	; 1
242:	80 83       	st	Z, r24
244:	e0 e8       	ldi	r30, 0x80	; 128
246:	f0 e0       	ldi	r31, 0x00	; 0
248:	80 81       	ld	r24, Z
24a:	81 60       	ori	r24, 0x01	; 1
24c:	80 83       	st	Z, r24
24e:	e1 eb       	ldi	r30, 0xB1	; 177
250:	f0 e0       	ldi	r31, 0x00	; 0
252:	80 81       	ld	r24, Z
254:	84 60       	ori	r24, 0x04	; 4
256:	80 83       	st	Z, r24
258:	e0 eb       	ldi	r30, 0xB0	; 176
25a:	f0 e0       	ldi	r31, 0x00	; 0
25c:	80 81       	ld	r24, Z
25e:	81 60       	ori	r24, 0x01	; 1
260:	80 83       	st	Z, r24
262:	ea e7       	ldi	r30, 0x7A	; 122
264:	f0 e0       	ldi	r31, 0x00	; 0
266:	80 81       	ld	r24, Z
268:	84 60       	ori	r24, 0x04	; 4
26a:	80 83       	st	Z, r24
26c:	80 81       	ld	r24, Z
26e:	82 60       	ori	r24, 0x02	; 2
270:	80 83       	st	Z, r24
272:	80 81       	ld	r24, Z
274:	81 60       	ori	r24, 0x01	; 1
276:	80 83       	st	Z, r24
278:	80 81       	ld	r24, Z
27a:	80 68       	ori	r24, 0x80	; 128
27c:	80 83       	st	Z, r24
27e:	10 92 c1 00 	sts	0x00C1, r1
282:	08 95       	ret

00000284 <analogReference>:

284:	80 93 00 01 	sts	0x0100, r24
288:	08 95       	ret

0000028a <analogRead>:

28a:	90 91 00 01 	lds	r25, 0x0100
28e:	92 95       	swap	r25
290:	99 0f       	add	r25, r25
292:	99 0f       	add	r25, r25
294:	90 7c       	andi	r25, 0xC0	; 192
296:	8f 70       	andi	r24, 0x0F	; 15
298:	98 2b       	or	r25, r24
29a:	90 93 7c 00 	sts	0x007C, r25
29e:	80 91 7a 00 	lds	r24, 0x007A
2a2:	80 64       	ori	r24, 0x40	; 64
2a4:	80 93 7a 00 	sts	0x007A, r24
2a8:	80 91 7a 00 	lds	r24, 0x007A
2ac:	86 fd       	sbrc	r24, 6
2ae:	fc cf       	rjmp	.-8      	; 0x2a8 <analogRead+0x1e>
2b0:	20 91 78 00 	lds	r18, 0x0078
2b4:	80 91 79 00 	lds	r24, 0x0079
2b8:	99 27       	eor	r25, r25
2ba:	98 2f       	mov	r25, r24
2bc:	88 27       	eor	r24, r24
2be:	33 27       	eor	r19, r19
2c0:	82 2b       	or	r24, r18
2c2:	93 2b       	or	r25, r19
2c4:	08 95       	ret

000002c6 <analogWrite>:

2c6:	1f 93       	push	r17
2c8:	cf 93       	push	r28
2ca:	df 93       	push	r29
2cc:	18 2f       	mov	r17, r24
2ce:	eb 01       	movw	r28, r22
2d0:	61 e0       	ldi	r22, 0x01	; 1
2d2:	0e 94 b7 01 	call	0x36e <pinMode>
2d6:	e1 2f       	mov	r30, r17
2d8:	ff 27       	eor	r31, r31
2da:	e8 59       	subi	r30, 0x98	; 152
2dc:	ff 4f       	sbci	r31, 0xFF	; 255
2de:	84 91       	lpm	r24, Z
2e0:	83 30       	cpi	r24, 0x03	; 3
2e2:	51 f4       	brne	.+20     	; 0x2f8 <analogWrite+0x32>
2e4:	80 91 80 00 	lds	r24, 0x0080
2e8:	80 68       	ori	r24, 0x80	; 128
2ea:	80 93 80 00 	sts	0x0080, r24
2ee:	d0 93 89 00 	sts	0x0089, r29
2f2:	c0 93 88 00 	sts	0x0088, r28
2f6:	37 c0       	rjmp	.+110    	; 0x366 <analogWrite+0xa0>
2f8:	84 30       	cpi	r24, 0x04	; 4
2fa:	51 f4       	brne	.+20     	; 0x310 <analogWrite+0x4a>
2fc:	80 91 80 00 	lds	r24, 0x0080
300:	80 62       	ori	r24, 0x20	; 32
302:	80 93 80 00 	sts	0x0080, r24
306:	d0 93 8b 00 	sts	0x008B, r29
30a:	c0 93 8a 00 	sts	0x008A, r28
30e:	2b c0       	rjmp	.+86     	; 0x366 <analogWrite+0xa0>
310:	81 30       	cpi	r24, 0x01	; 1
312:	29 f4       	brne	.+10     	; 0x31e <analogWrite+0x58>
314:	84 b5       	in	r24, 0x24	; 36
316:	80 68       	ori	r24, 0x80	; 128
318:	84 bd       	out	0x24, r24	; 36
31a:	c7 bd       	out	0x27, r28	; 39
31c:	24 c0       	rjmp	.+72     	; 0x366 <analogWrite+0xa0>
31e:	82 30       	cpi	r24, 0x02	; 2
320:	29 f4       	brne	.+10     	; 0x32c <analogWrite+0x66>
322:	84 b5       	in	r24, 0x24	; 36
324:	80 62       	ori	r24, 0x20	; 32
326:	84 bd       	out	0x24, r24	; 36
328:	c8 bd       	out	0x28, r28	; 40
32a:	1d c0       	rjmp	.+58     	; 0x366 <analogWrite+0xa0>
32c:	86 30       	cpi	r24, 0x06	; 6
32e:	41 f4       	brne	.+16     	; 0x340 <analogWrite+0x7a>
330:	80 91 b0 00 	lds	r24, 0x00B0
334:	80 68       	ori	r24, 0x80	; 128
336:	80 93 b0 00 	sts	0x00B0, r24
33a:	c0 93 b3 00 	sts	0x00B3, r28
33e:	13 c0       	rjmp	.+38     	; 0x366 <analogWrite+0xa0>
340:	87 30       	cpi	r24, 0x07	; 7
342:	41 f4       	brne	.+16     	; 0x354 <analogWrite+0x8e>
344:	80 91 b0 00 	lds	r24, 0x00B0
348:	80 62       	ori	r24, 0x20	; 32
34a:	80 93 b0 00 	sts	0x00B0, r24
34e:	c0 93 b4 00 	sts	0x00B4, r28
352:	09 c0       	rjmp	.+18     	; 0x366 <analogWrite+0xa0>
354:	c0 38       	cpi	r28, 0x80	; 128
356:	d1 05       	cpc	r29, r1
358:	14 f4       	brge	.+4      	; 0x35e <analogWrite+0x98>
35a:	60 e0       	ldi	r22, 0x00	; 0
35c:	01 c0       	rjmp	.+2      	; 0x360 <analogWrite+0x9a>
35e:	61 e0       	ldi	r22, 0x01	; 1
360:	81 2f       	mov	r24, r17
362:	0e 94 1e 02 	call	0x43c <digitalWrite>
366:	df 91       	pop	r29
368:	cf 91       	pop	r28
36a:	1f 91       	pop	r17
36c:	08 95       	ret

0000036e <pinMode>:

36e:	28 2f       	mov	r18, r24
370:	33 27       	eor	r19, r19
372:	c9 01       	movw	r24, r18
374:	84 58       	subi	r24, 0x84	; 132
376:	9f 4f       	sbci	r25, 0xFF	; 255
378:	fc 01       	movw	r30, r24
37a:	94 91       	lpm	r25, Z
37c:	20 57       	subi	r18, 0x70	; 112
37e:	3f 4f       	sbci	r19, 0xFF	; 255
380:	f9 01       	movw	r30, r18
382:	84 91       	lpm	r24, Z
384:	88 23       	and	r24, r24
386:	81 f0       	breq	.+32     	; 0x3a8 <pinMode+0x3a>
388:	e8 2f       	mov	r30, r24
38a:	ff 27       	eor	r31, r31
38c:	e2 55       	subi	r30, 0x52	; 82
38e:	ff 4f       	sbci	r31, 0xFF	; 255
390:	e4 91       	lpm	r30, Z
392:	ff 27       	eor	r31, r31
394:	66 23       	and	r22, r22
396:	29 f4       	brne	.+10     	; 0x3a2 <pinMode+0x34>
398:	80 81       	ld	r24, Z
39a:	90 95       	com	r25
39c:	89 23       	and	r24, r25
39e:	80 83       	st	Z, r24
3a0:	08 95       	ret
3a2:	80 81       	ld	r24, Z
3a4:	89 2b       	or	r24, r25
3a6:	80 83       	st	Z, r24
3a8:	08 95       	ret

000003aa <digitalRead>:

3aa:	48 2f       	mov	r20, r24
3ac:	55 27       	eor	r21, r21
3ae:	ca 01       	movw	r24, r20
3b0:	88 59       	subi	r24, 0x98	; 152
3b2:	9f 4f       	sbci	r25, 0xFF	; 255
3b4:	fc 01       	movw	r30, r24
3b6:	24 91       	lpm	r18, Z
3b8:	ca 01       	movw	r24, r20
3ba:	84 58       	subi	r24, 0x84	; 132
3bc:	9f 4f       	sbci	r25, 0xFF	; 255
3be:	fc 01       	movw	r30, r24
3c0:	94 91       	lpm	r25, Z
3c2:	40 57       	subi	r20, 0x70	; 112
3c4:	5f 4f       	sbci	r21, 0xFF	; 255
3c6:	fa 01       	movw	r30, r20
3c8:	34 91       	lpm	r19, Z
3ca:	33 23       	and	r19, r19
3cc:	a1 f1       	breq	.+104    	; 0x436 <digitalRead+0x8c>
3ce:	22 23       	and	r18, r18
3d0:	31 f1       	breq	.+76     	; 0x41e <digitalRead+0x74>
3d2:	23 30       	cpi	r18, 0x03	; 3
3d4:	21 f4       	brne	.+8      	; 0x3de <digitalRead+0x34>
3d6:	80 91 80 00 	lds	r24, 0x0080
3da:	8f 77       	andi	r24, 0x7F	; 127
3dc:	05 c0       	rjmp	.+10     	; 0x3e8 <digitalRead+0x3e>
3de:	24 30       	cpi	r18, 0x04	; 4
3e0:	31 f4       	brne	.+12     	; 0x3ee <digitalRead+0x44>
3e2:	80 91 80 00 	lds	r24, 0x0080
3e6:	8f 7d       	andi	r24, 0xDF	; 223
3e8:	80 93 80 00 	sts	0x0080, r24
3ec:	18 c0       	rjmp	.+48     	; 0x41e <digitalRead+0x74>
3ee:	21 30       	cpi	r18, 0x01	; 1
3f0:	19 f4       	brne	.+6      	; 0x3f8 <digitalRead+0x4e>
3f2:	84 b5       	in	r24, 0x24	; 36
3f4:	8f 77       	andi	r24, 0x7F	; 127
3f6:	04 c0       	rjmp	.+8      	; 0x400 <digitalRead+0x56>
3f8:	22 30       	cpi	r18, 0x02	; 2
3fa:	21 f4       	brne	.+8      	; 0x404 <digitalRead+0x5a>
3fc:	84 b5       	in	r24, 0x24	; 36
3fe:	8f 7d       	andi	r24, 0xDF	; 223
400:	84 bd       	out	0x24, r24	; 36
402:	0d c0       	rjmp	.+26     	; 0x41e <digitalRead+0x74>
404:	26 30       	cpi	r18, 0x06	; 6
406:	21 f4       	brne	.+8      	; 0x410 <digitalRead+0x66>
408:	80 91 b0 00 	lds	r24, 0x00B0
40c:	8f 77       	andi	r24, 0x7F	; 127
40e:	05 c0       	rjmp	.+10     	; 0x41a <digitalRead+0x70>
410:	27 30       	cpi	r18, 0x07	; 7
412:	29 f4       	brne	.+10     	; 0x41e <digitalRead+0x74>
414:	80 91 b0 00 	lds	r24, 0x00B0
418:	8f 7d       	andi	r24, 0xDF	; 223
41a:	80 93 b0 00 	sts	0x00B0, r24
41e:	e3 2f       	mov	r30, r19
420:	ff 27       	eor	r31, r31
422:	ec 55       	subi	r30, 0x5C	; 92
424:	ff 4f       	sbci	r31, 0xFF	; 255
426:	e4 91       	lpm	r30, Z
428:	ff 27       	eor	r31, r31
42a:	80 81       	ld	r24, Z
42c:	89 23       	and	r24, r25
42e:	19 f0       	breq	.+6      	; 0x436 <digitalRead+0x8c>
430:	81 e0       	ldi	r24, 0x01	; 1
432:	90 e0       	ldi	r25, 0x00	; 0
434:	08 95       	ret
436:	80 e0       	ldi	r24, 0x00	; 0
438:	90 e0       	ldi	r25, 0x00	; 0
43a:	08 95       	ret

0000043c <digitalWrite>:

43c:	48 2f       	mov	r20, r24
43e:	55 27       	eor	r21, r21
440:	ca 01       	movw	r24, r20
442:	88 59       	subi	r24, 0x98	; 152
444:	9f 4f       	sbci	r25, 0xFF	; 255
446:	fc 01       	movw	r30, r24
448:	24 91       	lpm	r18, Z
44a:	ca 01       	movw	r24, r20
44c:	84 58       	subi	r24, 0x84	; 132
44e:	9f 4f       	sbci	r25, 0xFF	; 255
450:	fc 01       	movw	r30, r24
452:	94 91       	lpm	r25, Z
454:	40 57       	subi	r20, 0x70	; 112
456:	5f 4f       	sbci	r21, 0xFF	; 255
458:	fa 01       	movw	r30, r20
45a:	34 91       	lpm	r19, Z
45c:	33 23       	and	r19, r19
45e:	c1 f1       	breq	.+112    	; 0x4d0 <digitalWrite+0x94>
460:	22 23       	and	r18, r18
462:	31 f1       	breq	.+76     	; 0x4b0 <digitalWrite+0x74>
464:	23 30       	cpi	r18, 0x03	; 3
466:	21 f4       	brne	.+8      	; 0x470 <digitalWrite+0x34>
468:	80 91 80 00 	lds	r24, 0x0080
46c:	8f 77       	andi	r24, 0x7F	; 127
46e:	05 c0       	rjmp	.+10     	; 0x47a <digitalWrite+0x3e>
470:	24 30       	cpi	r18, 0x04	; 4
472:	31 f4       	brne	.+12     	; 0x480 <digitalWrite+0x44>
474:	80 91 80 00 	lds	r24, 0x0080
478:	8f 7d       	andi	r24, 0xDF	; 223
47a:	80 93 80 00 	sts	0x0080, r24
47e:	18 c0       	rjmp	.+48     	; 0x4b0 <digitalWrite+0x74>
480:	21 30       	cpi	r18, 0x01	; 1
482:	19 f4       	brne	.+6      	; 0x48a <digitalWrite+0x4e>
484:	84 b5       	in	r24, 0x24	; 36
486:	8f 77       	andi	r24, 0x7F	; 127
488:	04 c0       	rjmp	.+8      	; 0x492 <digitalWrite+0x56>
48a:	22 30       	cpi	r18, 0x02	; 2
48c:	21 f4       	brne	.+8      	; 0x496 <digitalWrite+0x5a>
48e:	84 b5       	in	r24, 0x24	; 36
490:	8f 7d       	andi	r24, 0xDF	; 223
492:	84 bd       	out	0x24, r24	; 36
494:	0d c0       	rjmp	.+26     	; 0x4b0 <digitalWrite+0x74>
496:	26 30       	cpi	r18, 0x06	; 6
498:	21 f4       	brne	.+8      	; 0x4a2 <digitalWrite+0x66>
49a:	80 91 b0 00 	lds	r24, 0x00B0
49e:	8f 77       	andi	r24, 0x7F	; 127
4a0:	05 c0       	rjmp	.+10     	; 0x4ac <digitalWrite+0x70>
4a2:	27 30       	cpi	r18, 0x07	; 7
4a4:	29 f4       	brne	.+10     	; 0x4b0 <digitalWrite+0x74>
4a6:	80 91 b0 00 	lds	r24, 0x00B0
4aa:	8f 7d       	andi	r24, 0xDF	; 223
4ac:	80 93 b0 00 	sts	0x00B0, r24
4b0:	e3 2f       	mov	r30, r19
4b2:	ff 27       	eor	r31, r31
4b4:	e7 55       	subi	r30, 0x57	; 87
4b6:	ff 4f       	sbci	r31, 0xFF	; 255
4b8:	e4 91       	lpm	r30, Z
4ba:	ff 27       	eor	r31, r31
4bc:	66 23       	and	r22, r22
4be:	29 f4       	brne	.+10     	; 0x4ca <digitalWrite+0x8e>
4c0:	80 81       	ld	r24, Z
4c2:	90 95       	com	r25
4c4:	89 23       	and	r24, r25
4c6:	80 83       	st	Z, r24
4c8:	08 95       	ret
4ca:	80 81       	ld	r24, Z
4cc:	89 2b       	or	r24, r25
4ce:	80 83       	st	Z, r24
4d0:	08 95       	ret

000004d2 <__udivmodsi4>:

4d2:	a1 e2       	ldi	r26, 0x21	; 33
4d4:	1a 2e       	mov	r1, r26
4d6:	aa 1b       	sub	r26, r26
4d8:	bb 1b       	sub	r27, r27
4da:	fd 01       	movw	r30, r26
4dc:	0d c0       	rjmp	.+26     	; 0x4f8 <__udivmodsi4_ep>

000004de <__udivmodsi4_loop>:

4de:	aa 1f       	adc	r26, r26
4e0:	bb 1f       	adc	r27, r27
4e2:	ee 1f       	adc	r30, r30
4e4:	ff 1f       	adc	r31, r31
4e6:	a2 17       	cp	r26, r18
4e8:	b3 07       	cpc	r27, r19
4ea:	e4 07       	cpc	r30, r20
4ec:	f5 07       	cpc	r31, r21
4ee:	20 f0       	brcs	.+8      	; 0x4f8 <__udivmodsi4_ep>
4f0:	a2 1b       	sub	r26, r18
4f2:	b3 0b       	sbc	r27, r19
4f4:	e4 0b       	sbc	r30, r20
4f6:	f5 0b       	sbc	r31, r21

000004f8 <__udivmodsi4_ep>:

4f8:	66 1f       	adc	r22, r22
4fa:	77 1f       	adc	r23, r23
4fc:	88 1f       	adc	r24, r24
4fe:	99 1f       	adc	r25, r25
500:	1a 94       	dec	r1
502:	69 f7       	brne	.-38     	; 0x4de <__udivmodsi4_loop>
504:	60 95       	com	r22
506:	70 95       	com	r23
508:	80 95       	com	r24
50a:	90 95       	com	r25
50c:	9b 01       	movw	r18, r22
50e:	ac 01       	movw	r20, r24
510:	bd 01       	movw	r22, r26
512:	cf 01       	movw	r24, r30
514:	08 95       	ret

</source>

<source lang="text"> 000011001001010001011010000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100100101000000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000001100100101000111010100000000000011001001010001110101000000000000110010010100011101010000000000000000000000000000000000000111000000000000001000000001000000000000000000000011000001000000011000000000000000000000000000000000000000000000000000000000000000000000000100000010000001000000100000010000001000000100000010000000000000010000001000000100000010000001000000100000000000010000001000000100000010000001000000100000000001000000010000000100000001000000010000000100000001000000010000000010000000100000001000000010000000100000001000000011000000110000001100000011000000110000001100000000000000000010001100100110001010010000000000000000001001010010100000101011000000000000000000100100001001110010101000000000000100010010010000011111101111101100111111101111110101001110000011011110101111111100110110111111000100011110000010100000111000001011000111100000111001101110000111110101111000000000001011000000000001011001000000001101100100101010001000110000101100010000011111011001111101110001000111100000101000101110000010110001111000000000000111000000000111011001001010100110001100001011000100000111111000011111011100001100100101001000100100000000000011001001010000000000000000000110000111100000100011011110000000001110100101001011011100000001000010001001010110000000111000000000111010010100010001010000000110001000001111001001000100000101000101001111010001100001111000000000000111000000011000001110000010001101111000000000111010010100000111100000001000001000100101011100111111101111110101001110000011011110101111111100110110111111000011101001010000000000000000010000111010010100011101110000000000001110100101000111110000000000111111011100111100011111100100100000111110010010000011111011011000001111100100100001000100100100100011111001001110011111100100111010111110010011101111111001001110000000100100010000001000000001100100001001000100000011000000011010000010010001000001000000000110110000100100010000010100000001000000011001011010100001000111011011000100011101100000001001001100000010000000011001000010010011000000110000000110100000100100110000010000000001101100001001001100000101000000011011111110010001101011111001000110011111100100011000111110010001000011111001000000001111101111100000111110010000000111111001000000011000100101010110000010010001000000100000000101110000100100010000001100000001100000001001000100000100000000011001000010010001000001010000000100100111111000000110011000001111011101110001111110001000000111111001100100011111001010101001010111010001111101110010110111100111001100001110000001000000111000000101000011100000000011101001010001101001000000101100101000000001101110010000000100001000100101011010111110010010101111111001001011001111100100101101111110010010111011111001001011111111100100100000111110010011000111111001001101011011000000010110110000000001000011101001010010111001000000000111101100000001100011000000000100001110100101001011100100000000011011100001100101111111000010011000000000001011100100010000101101101010000101010111101100000101100011000000010110011101000001011010100011110011000111111001000100001111100100011111111110010000111011111001000011011111100100001100111110010000101111111001000010101111100100000000100010010101000000011001011101010001111100001000100000001111100110010001111110001000000011111001100100011111000000101001011100101111101101111111100010010100000000011001011111110001111101110010111110111111000010001001010101111000100101000001000010010010000000100000000100010000100100100000001100000001000100001001001000000100000000010001000010010010000001010000000110000100101101011000001001100000100001001011110110000100101101011000000101100000100001001011110110000101101101011000001001100000100001011011110110000101101101011000000101100000100001011011110111101110111001101111000011100000100000001000000110000001011000001000000010000011111000011110100011110000111000001000000010000001100000100110000010000000100000111000000010000001100000010110000010000000100000111110000011101000111100001110000010000000100000011000000101100000100000001000001111100001111010111111000011100000100000001000000110000100011000001000000010000011111000001110101111110000111000001000000010000001100000010110000010000000100000111110101011100111111100001110000010000000100000011000010001100000100000001000001110000000100000011000001001100000100000001000001110000000100000011000000101100000100000001000001110000000100000011000000001101000100000001000001100010000100100101100000100000000000010001001010110000000100100110000000000000001000010001001010110010000100100010000000000000001100100101001010110011001000011111001100100001111100100000111110010001111011100001001100000101011100100001001001101111100000000001000000010010001011110100000000010000000011001001000000010010011011110100000000010000000100100010111101000000000100001101111110111111100110011110010000010010001011110000000000010000000100100010111100100000000100110010010011110011000001011111000100000100111001100110010011110000010001010111001001100101011000010001001010100011111100100111100111110010011110111111001001100011000001011111110101100000001011000011110000000001110100101001011011100000001111000010010111111111111001001111110100001011001111111110100111110000100100100011000001100110000010100011111010010000000100100011000000000000000100000000110100010000000100100111000000000000000110100001001001110001001000000001100000010010011100010000000000000110111110000001000010000110000010100011111010010000000100100011000000000000000100000000110001010000000100100111000000000000000110100001001001110001011000000001100000010010011100010100000000000101011110000001000000100110000001010011111010010000100101101011000000001101000100001001011110111000111101111010010010011000000100000100011000000101001111101001000010010110101100000000110001010000100101111011100100010111101000111011100000010000110001100000100000111110100100000001001000110110000000000001000000001101000100000001001001110110000000000001100000010010011101100110000000000010011110000001000011100110000010000011111010010000000100100011011000000000000100000000110001010000000100100111011000000000000110000001001001110110100000000000000100111000000110000000011100011010001000001010001010011110100011000001110000000000001110000000110000111100000100000010010111100001110100101000001111000000010110111111001000111001111100100010001111110010001000010001001010100101000001011110011001100100111110010010000000110000100010110001001111101001111111111000000000110010100100100010010000001010111001111110100111111111001000000011000010010010001100010000010001110000001111100001110100000101111111111110010011111100010010101011111111101001111111001001001000111111111001001110110011000100011001010011111010010000000100000011001000010010101100010010010001110000000100000110000100010010101100000001000000110001001001010111000000010000011000010001001010101001000001011110101010100100111110010100000000110001000010110011001111101001111111111000000000100100100100100011100101000000001100001000101100010011111010011111111110000000001100101001001000101000000010101110101111101001111111110100000000100110100100100010011001100100011101000011111000100100010001000110011000111110001001000110011000000100001111101001000000010010001100000000000000010001111011101110000010111000000001001000011000000110001111101001000000010010001100000000000000010001111011111011000000010010011100000000000000000011000110000000010000100110000000110011111010010000100101101011000111101110111000001001100000000100010001100000010000111110100100001001011010110001111011111011000010010111101000011011100000000100110001100000010000111110100100000001001000110110000000000001000111101110111000001011100000000100111001100000010100111110100100000001001000110110000000000001000111101111101100000001001001110110000000000001110001100101111111111110010011111101100010101011111111101001111111001001001000111111111001001111000000010000001100010010010001100011001111100001000000111100000100100001110000000001000100101011000000011100000100100001110000000001000100101010100100000101111010101010010011111001010000000011000100001011001100111110100111111111100000000010010010010010001110010100000000110000100010110001001111101001111111111000000000110010100100100010100000001010111010111110100111111111010000000010011010010010001001100110010001111000001111100010010001000100011001100011111000100100011001100000010000111110100100000001001000110000000000000001000111101110111000001011100000000100100001100000011000111110100100000001001000110000000000000001000111101111101100000001001001110000000000000000001100011000000001000010011000000011001111101001000010010110101100011110111011100000100110000000010001000110000001000011111010010000100101101011000111101111101100001001011110100001101110000000010011000110000001000011111010010000000100100011011000000000000100011110111011100000101110000000010011100110000001010011111010010000000100100011011000000000000100011110111110110000000100100111011000000000000111000110010111111111111001001111110011101010101111111110100111111100100100100011111111100100111011001100010001100101001111101001000000010000001100100001001010110001001001000111000000010000011000010001001010110000000100000011000100100101011100000001000001100001000100101011010000111100010000110100010111010101010000110111011101100011011111111010000000100001101110000001010101000011111101110110001111111101110000111111111111100011111101000100001011110110011000001111110010000000111111101010000011100100000111100001010001000011011101100110000101111100100000010111111010100001011011001100001111101110111000111111000100000011111100110010001111100011010100101000110100111110111011000001001010101110000100101011000000010010101100100001001010110011011000000011010110000000001101111010000000111001111000000010000100010010101 </source>