Program mam takyto :
Kód: Vybrat vše
$regfile = "m8def.dat"
$crystal = 4000000
$hwstack = 40
$swstack = 16
$framesize = 32
Config Portc.0 = Output 'hl.n biela
Config Portc.1 = Output 'hl.n cervena
Config Portc.2 = Output 'hl.n biela
Config Portc.3 = Output 'hl.n Z
Config Portd.0 = Output 'opakovacie biela
Config Portd.1 = Output 'opakovacie modra
Config Portd.2 = Output 'opakovacie biela
Config Portd.3 = Output 'opakovacie Z
Config Portb.0 = Input 'tlacit zakazane
Config Portb.1 = Input 'tlacit pomaly
Config Portb.2 = Input 'tlacit rychlejsie
Config Portb.3 = Input 'tlacit spat
Do
If Pinb.0 = 1 Then
Portc.1 = 1
Portd.1 = 1
End If
If Pinb.1 = 1 Then
Portc.0 = 1
Portc.2 = 1
Portd.0 = 1
Portd.2 = 1
End If
If Pinb.2 = 1 Then
Portc.0 = 1
Portd.0 = 1
End If
If Pinb.3 = 1 Then
Portc.1 = 1
Portc.3 = 1
Portd.1 = 1
Portd.3 = 1
End If
Loop
End
Ako treba upravit program aby obvod fungoval podla schemy? Schemu by som nerad menil ak to nebude treba. Myslim ze by stacilo v programe zmenit 1 na 0 pri tlacitkach cize if pinb.3=0 napr. ale niesom si isty ci to bude stacit tak chcem pocut radu od skusenejsich. Robim to ako doplnenie k soč.