Bascom
Kód: Vybrať všetko
$regfile = "m644pdef.dat"
$baud = 2400
$crystal = 8000000
$hwstack = 32
$swstack = 8
$framesize = 16
'Konfiguracia LCD displeja
Config Lcdpin = Pin , Db4 = Porta.0 , Db5 = Porta.1 , Db6 = Porta.2 , Db7 = Porta.3 , E = Porta.4 , Rs = Porta.5
Config Lcd = 16 * 2
Cls
Cursor Off
'Konfiguracia seriovej linky pre prijem dat z PC
Config Serialin = Buffered , Size = 10
'Povolenie globalnych preruseni
Enable Interrupts
'Konfiguracia I/O portov
Config Porta.6 = Output
'Pomenovanie I/O portov
Led Alias Porta.6
'Nastavenie I/O portov na pociatocnu hodnotu
Led = 1
Dim A As Byte
A = 0
Do
Inputbin A
Lcd A
Loop
End
Kód: Vybrať všetko
If SerialPort1.IsOpen = True Then
Dim A As Byte
A = 25
TextBox1.Text = "Zapnuté"
SerialPort1.Write(A)
End If