nie wiem czy to pomoze albo nie zatka forum ale prosze :
ten program jest jeszcze niedorobiony ale powinien wyświetlać zmienne
wrsja bascoma to 1.11.6.2
Config Lcdpin = Pin , Db4 = Porta.5 , Db5 = Porta.4 , Db6 = Porta.3 , Db7 = Porta.2 , E = Porta.6 , Rs = Porta.7
Config Lcd = 16 * 2
Config Rc5 = Pind.2
Dim Adress As Byte
Dim R As Byte
Dim Command As Byte
Dim Var As Byte
Dim Reg As Byte
Dim Vol As Byte
Dim Bass As Byte
Dim Treb As Byte
Dim Ef As Byte
Dim Stereo As Bit
Dim Pseudo As Bit
Dim Spatial As Bit
Dim X As Byte
Declare Sub Volume
Declare Sub Bass
Declare Sub Treble
Declare Sub Wysyl
Declare Sub Effect
Declare Sub Pilot
Declare Sub Wysw
Declare Sub Klaw
Config Sda = Portc.1
Config Scl = Portc.2
Speaker Alias Portc.0
Cls
Lcd " zaraz odpale"
Wait 1
Cls
Lcd "cos tam pisze"
Vol = 5
Call Volume
Bass = 10
Call Bass
Treb = 10
Call Treble
Call Effect
Stereo = 1
Wait 2
Set Speaker
Lowerline
Lcd " no juz hehe "
Enable Interrupts
Do
Getrc5(adress , Command)
If Adress = 19 Then
Disable Interrupts
Command = Command And &B10111111
Call Pilot
End If
I2cstart
I2cwbyte 113
I2crbyte X , 9
I2cstop
If X < 255 Then
Call Klaw
End If
Loop
Volume:
Reg = 0
Var = 218 + Vol
Call Wysyl
Reg = 1
Var = 218 + Vol
Call Wysyl
Return
Bass:
Reg = 2
Var = 241 + Bass
Call Wysyl
Return
Treble:
Reg = 3
Var = 241 + Treb
Call Wysyl
Return
Effect:
Reg = 8
Ef = &B11000000
If Spatial = 1then
Ef = Ef + &B11011000
End If
If Pseudo = 1 Then
Ef = Ef + &B11001000
End If
If Stereo = 1 Then
Ef = Ef + &B11010000
End If
Var = Ef
Call Wysyl
Return
Wysyl:
I2cstart
I2cwbyte 130
I2cwbyte Reg
I2cwbyte Var
I2cstop
Return
Pilot:
If Command = 16 Then
Incr Vol
If Vol > 35 Then
Vol = 35
End If
End If
If Command = 17 Then
Decr Vol
If Vol < 1 Then
Vol = 1
End If
End If
Call Volume
If Command = 24 Then
Incr Treb
If Treb > 11 Then
Treb = 11
End If
End If
If Command = 25 Then
Decr Treb
If Treb < 1 Then
Treb = 1
End If
End If
Call Treble
If Command = 22 Then
Incr Bass
If Bass > 12 Then
Bass = 12
End If
End If
If Command = 23 Then
Decr Bass
If Bass < 1 Then
Bass = 1
End If
End If
Call Bass
If Command = 1 Then
If Stereo = 1 Then
Reset Stereo
Set Spatial
Else
Set Stereo
Reset Spatial
End If
Call Effect
End If
Call Wysw
Command = 255
Return
Wysw:
Cls
Upperline
Lcd " Volume: " ; Vol
Lowerline
Lcd "Bass " ; Bass ; " Treb " ; Treb
Waitms 100
Enable Interrupts
Return
Klaw:
If X = &B11111110 Then
Command = 16
End If
If X = &B11111101 Then
Command = 17
End If
Call Pilot
Return