20.01.2015 Views

Parque de estacionamento automatizado

Parque de estacionamento automatizado

Parque de estacionamento automatizado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Relatório da Prova <strong>de</strong> Aptidão Profissional – Bruno Barbosa<br />

For Contador = 1 to 11<br />

'Espera que o Clock vá ao nível lógico baixo<br />

Loop4:<br />

If PS2_CLK = On Then<br />

Goto Loop4<br />

End If<br />

'Ignora o Start Bit, o Parity Bit e o Stop Bit<br />

If Contador = 1 Or Contador = 10 Or Contador = 11 then<br />

Goto Loop5<br />

End If<br />

'Desloca para a direita<br />

Rotate Key_Co<strong>de</strong> Right<br />

'Regista o estado da linha <strong>de</strong> dados do teclado<br />

Key_Co<strong>de</strong>.7 = PS2_DAT<br />

'Espera que o Clock vá ao nível lógico alto<br />

Loop5:<br />

If PS2_CLK = Off Then<br />

Goto Loop5<br />

End If<br />

Next Contador<br />

Wait 100 us<br />

Exit Sub<br />

End Sub<br />

'''Converte código do teclado no código ASCII do caráter<br />

Sub GetKeyChar<br />

If Key_Co<strong>de</strong> = 0x70 Then<br />

Key_Char = 48<br />

Else<br />

If Key_Co<strong>de</strong> = 0x69 Then<br />

Key_Char = 49<br />

Else<br />

If Key_Co<strong>de</strong> = 0x72 Then<br />

Key_Char = 50<br />

- 26 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!