سلام دوستان
یه برنامه یکی از این بچه های سایت نوشته برای ولوم کنترول دجیتال که با کلید بالا پایین میشه... حالا من میخوام با ولوم انکودر یا هرز گرد کنترول بشه...
کسی هست بتونه برنامشو واسم edit کنه؟؟؟
من میکرو بلد نیستم.
ممنون میشم کمکم کنید
یه برنامه یکی از این بچه های سایت نوشته برای ولوم کنترول دجیتال که با کلید بالا پایین میشه... حالا من میخوام با ولوم انکودر یا هرز گرد کنترول بشه...
کسی هست بتونه برنامشو واسم edit کنه؟؟؟
من میکرو بلد نیستم.
ممنون میشم کمکم کنید

کد:
$regfile = "m16def.dat" $crystal = 1000000 Cls Locate 1 , 1 Lcd "MASOUD SYSTEM" Locate 2 , 1 Lcd "POWER AMPELIFIER" Waitms 2000 Dim S As Byte For S = 0 To 16 Waitms 20 Shiftlcd Right Next Cls Locate 1 , 1 Lcd " System Check " Locate 2 , 1 Lcd "Waiting ..." Waitms 3500 Dim Z As Byte For Z = 0 To 16 Waitms 100 Shiftlcd Left Next Const Ptw = &H88 Const Ptr = &H89 Config Sda = Portd.1 Config Scl = Portd.0 Config Portc = Input Config Lcdpin = Pin , Db4 = Pina.4 , Db5 = Pina.5 , Db6 = Pina.6 , Db7 = Pina.7 , Rs = Pina.2 , E = Pina.3 Config Lcd = 16 * 2 Cursor Off Cls '******************************************************************************* Dim Vol As Byte Dim Loud As Bit Dim Selector As Byte Dim Bass As Byte Dim Treble As Byte Dim Lr As Byte Dim Rr As Byte Dim Lf As Byte Dim Rf As Byte Dim _time As Byte Dim A As Byte Dim B As Byte Dim C As Byte Dim D As Byte Dim E As Byte Dim F As Byte Dim G As Byte Dim H As Byte Dim I As Byte Dim L As Byte '******************************************************************************* Portc = 255 Vol = 38 Lr = 192 Rr = 224 Lf = 128 Rf = 160 A = 10 B = 10 G = 1 H = 92 '******************************************************************************* I2cstart I2cwbyte Ptw I2cwbyte 64 I2cwbyte 224 I2cwbyte 192 I2cwbyte 160 I2cwbyte 128 I2cwbyte 125 I2cwbyte 109 I2cwbyte 43 I2cstop '******************************************************************************* Home Do If Pinc.1 = 0 Or Pinc.2 = 0 Then If Pinc.1 = 0 Then Incr Vol If Pinc.2 = 0 Then Decr Vol If Vol = 255 Then Vol = 0 If Vol > 63 Then Vol = 63 End If L = 63 - Vol If L < 10 Then Locate 1 , 16 Lcd " " End If Locate 1 , 1 Lcd "VOLUME " ; L Locate 2 , 1 Lcd "MASOUD.LIZARD" I2cstart I2cwbyte Ptw I2cwbyte Vol I2cstop Waitms 50 If Pinc.0 = 0 Then Incr _time If _time > 20 Then Gosub Loudset End If If Pinc.0 = 1 And _time > 1 Then _time = 0 Gosub Setting End If Loop '******************************************************************************* Setting: _time = 0 While _time < 25 Locate 1 , 1 Select Case Selector Case 0 Lcd "BASS " ; A If A < 10 Then Locate 1 , 16 Lcd " " End If Case 1 Lcd "TREBLE " ; B If B < 10 Then Locate 1 , 16 Lcd " " End If Case 2 Lcd "SPEAKER LR " ; C If C < 10 Then Locate 1 , 16 Lcd " " End If Case 3 Lcd "SPEAKER RR " ; D If D < 10 Then Locate 1 , 16 Lcd " " End If Case 4 Lcd "SPEAKER LF " ; E If E < 10 Then Locate 1 , 16 Lcd " " End If Case 5 Lcd "SPEAKER RF " ; F If F < 10 Then Locate 1 , 16 Lcd " " End If Case 6 Locate 1 , 1 Lcd "selector " ; G ; " " End Select Incr _time Waitms 250 If Pinc.0 = 0 Then Incr Selector _time = 0 End If If Selector > 6 Then Selector = 0 If Pinc.1 = 0 Then Gosub Up Waitms 20 If Pinc.2 = 0 Then Gosub Down Waitms 20 Wend _time = 0 Return '******************************************************************************* Up: _time = 0 Select Case Selector Case 0 Decr A If A = 255 Then A = 0 If A = 0 Then Bass = 96 If A = 1 Then Bass = 97 If A = 2 Then Bass = 98 If A = 3 Then Bass = 99 If A = 4 Then Bass = 100 If A = 5 Then Bass = 101 If A = 6 Then Bass = 102 If A = 7 Then Bass = 103 If A = 8 Then Bass = 111 If A = 9 Then Bass = 110 If A = 10 Then Bass = 109 If A = 11 Then Bass = 108 If A = 12 Then Bass = 107 If A = 13 Then Bass = 106 If A = 14 Then Bass = 105 If A = 15 Then Bass = 104 I2cstart I2cwbyte Ptw I2cwbyte Bass I2cstop Case 1 Decr B If B = 255 Then B = 0 If B = 0 Then Treble = 112 If B = 1 Then Treble = 113 If B = 2 Then Treble = 114 If B = 3 Then Treble = 115 If B = 4 Then Treble = 116 If B = 5 Then Treble = 117 If B = 6 Then Treble = 118 If B = 7 Then Treble = 119 If B = 8 Then Treble = 127 If B = 9 Then Treble = 126 If B = 10 Then Treble = 125 If B = 11 Then Treble = 124 If B = 12 Then Treble = 123 If B = 13 Then Treble = 122 If B = 14 Then Treble = 121 If B = 15 Then Treble = 120 I2cstart I2cwbyte Ptw I2cwbyte Treble I2cstop Case 2 Decr Lr Decr C If C = 255 Then C = 0 If Lr < 192 Then Lr = 192 I2cstart I2cwbyte Ptw I2cwbyte Lr I2cstop Case 3 Decr Rr Decr D If D = 255 Then D = 0 If Rr < 224 Then Rr = 224 I2cstart I2cwbyte Ptw I2cwbyte Rr I2cstop Case 4 Decr Lf Decr E If E = 255 Then E = 0 If Lf < 128 Then Lf = 128 I2cstart I2cwbyte Ptw I2cwbyte Lf I2cstop Case 5 Decr Rf Decr F If F = 255 Then F = 0 If Rf < 160 Then Rf = 160 I2cstart I2cwbyte Ptw I2cwbyte Rf I2cstop Case 6 Decr G Decr H If G < 1 Then G = 1 If H < 92 Then H = 92 I2cstart I2cwbyte Ptw I2cwbyte H I2cstop Waitms 50 End Select Return '******************************************************************************* Down: _time = 0 Select Case Selector Case 0 Incr A If A > 15 Then A = 15 If A = 255 Then A = 0 If A = 0 Then Bass = 96 If A = 1 Then Bass = 97 If A = 2 Then Bass = 98 If A = 3 Then Bass = 99 If A = 4 Then Bass = 100 If A = 5 Then Bass = 101 If A = 6 Then Bass = 102 If A = 7 Then Bass = 103 If A = 8 Then Bass = 111 If A = 9 Then Bass = 110 If A = 10 Then Bass = 109 If A = 11 Then Bass = 108 If A = 12 Then Bass = 107 If A = 13 Then Bass = 106 If A = 14 Then Bass = 105 If A = 15 Then Bass = 104 I2cstart I2cwbyte Ptw I2cwbyte Bass I2cstop Case 1 Incr B If B > 15 Then B = 15 If B = 0 Then Treble = 112 If B = 1 Then Treble = 113 If B = 2 Then Treble = 114 If B = 3 Then Treble = 115 If B = 4 Then Treble = 116 If B = 5 Then Treble = 117 If B = 6 Then Treble = 118 If B = 7 Then Treble = 119 If B = 8 Then Treble = 127 If B = 9 Then Treble = 126 If B = 10 Then Treble = 125 If B = 11 Then Treble = 124 If B = 12 Then Treble = 123 If B = 13 Then Treble = 122 If B = 14 Then Treble = 121 If B = 15 Then Treble = 120 I2cstart I2cwbyte Ptw I2cwbyte Treble I2cstop Case 2 Incr Lr Incr C If C > 31 Then C = 31 If Lr > 223 Then Lr = 223 I2cstart I2cwbyte Ptw I2cwbyte Lr I2cstop Case 3 Incr Rr Incr D If D > 30 Then D = 30 If Rr > 254 Then Rr = 254 I2cstart I2cwbyte Ptw I2cwbyte Rr I2cstop Case 4 Incr Lf Incr E If E > 31 Then E = 31 If Lf > 159 Then Lf = 159 I2cstart I2cwbyte Ptw I2cwbyte Lf I2cstop Case 5 Incr Rf Incr F If F > 31 Then F = 31 If Rf > 191 Then Rf = 191 I2cstart I2cwbyte Ptw I2cwbyte Rf I2cstop Case 6 Incr G Incr H If G > 3 Then G = 3 If H > 94 Then H = 94 I2cstart I2cwbyte Ptw I2cwbyte H I2cstop Waitms 50 End Select Return '******************************************************************************* Loudset: Locate 1 , 1 Lcd "LOUD " _time = 0 Locate 1 , 6 Toggle Loud If Loud = 1 Then If G = 1 Then I = 92 If G = 2 Then I = 93 If G = 3 Then I = 94 Lcd "OFF " Else If G = 1 Then I = 64 If G = 2 Then I = 65 If G = 3 Then I = 66 Lcd "ON " End If I2cstart I2cwbyte Ptw I2cwbyte I I2cstop Wait 2 Return
دیدگاه