提问人:Luardwx 提问时间:11/13/2023 最后编辑:Philippe SignoretLuardwx 更新时间:11/13/2023 访问量:30
我怎样才能达到这个要求的一致性?
How can I reach the align of this requirement?
问:
我目前正在编写代码,以显示应用于Arduino设备的每个操作的状态和相应的时间戳。但是,输出不符合指定的要求。相反,它看起来像这样:
有人可以帮我解决这个格式问题吗?我感谢任何回应和帮助。谢谢!
updateTick:
call delay100ms
lds r22, sec1
cpi r22, 10
brne ut2
ldi r22, 0
sts sec1, r22
lds r23, cstate
cpi r23, COOKS
brne ut1
lds r24, seconds
lds r25, seconds+1
cpi r24, 0
brne ut3
jmp idle
ldi r23, IDLES
sts cstate, r23
cbi PORTB, BEEPER
rjmp ut1;
ut3:
dec r24
sts seconds, r24
sts seconds+1, r25
ut1:
call displayState
call displayTOD
call displayCookTime
ut2:
lds r22, sec1
inc r22
sts sec1, r22
call delay1s ; Call to delay1s
cbi PORTD,BEEPER
displayCookTime:
ldi ZL, LOW(msg2<<1)
ldi ZH, HIGH(msg2<<1)
ldi r16,1
call putsUSART0
ldi r16, 0
ldi r20, '0'
st z+, r20
st z+, r20
st z+, r20
ldi r20, '1'
st z+, r20
st z+, r20
call itoa_short ; Convert to an ASCII string in tascii
ldi r20,0x00
sts tascii+5, r20
sts tascii+6, r20
sts tascii+7, r20
ldi ZL,LOW(tascii)
ldi ZH,HIGH(tascii)
ldi r16,0
call putsUSART0
ret
msg2: .db " Cooking Time: ",0,0
答: 暂无答案
评论