0

如何同时打开引脚 13 和 12?

ldi r18,0x20  ; bit 5 (pin 13) = high
out 5,r18     ; output to port B

ldi r18,0x10  ; bit 4 (pin 12) = high 
out 5,r18     ; output to port B
4

1 回答 1

1

只需将值按位或一起设置即可;

ldi r18,0x30  ; 0x20 (bit 5) OR 0x10 (bit 4) = 0x30 sets bit 4 and 5 high
out 5,r18     ; output to port B
于 2014-05-30T15:44:33.673 回答