سلام من یه برنامه دارم به زبان bascom اما هیچی از این برنامه متوجه نمیشم چون زبان c رو فقط بلدم اگه میشه یکی اینو تبدیل کنه برام ممنون میشم
$regfile = "m16def.dat"
$crystal = 8000000
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pinb.5 , Db5 = Pinb.4 , Db6 = Pinb.3 , Db7 = Pinb.2 , E = Pinb.6 , Rs = Pinb.7
Config Portd = Input
Config Portc = Output
Dim M As Byte
Dim A As Byte
Dim B As Single
Dim C As Byte
Dim Fixe As Byte
Dim Inte As Bit
C = 0
A = 0
Readeeprom Fixe , M
Cls
Main:
Do
Start Adc
A = Getadc(0)
Stop Adc
C = A / 1.9
B = C / 100
Home
Lcd "kpa:" ; C ; " "
Locate 2 , 1
Lcd "BAR:"
Locate 2 , 6
Lcd Fusing(b , "#.&&" )
If Pind.2 = 1 Then
Goto Seting
End If
If Fixe < C Then
Reset Portc.0
If Inte = 0 Then
Inte = 1
Goto Full
End If
Else
Inte = 0
Set Portc.0
End If
Loop
End 'end program
زیر برنامه بیزر حالت تثبیت Full:
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Goto Main
Seting:
Cls
If Pind.2 = 1 Then
Home
Lcd "fix kpa:" ; Fixe ; " "
If Pind.0 = 1 Then
Fixe = Fixe + 1
Writeeeprom Fixe , M
Waitms 200
End If
If Pind.1 = 1 Then
Fixe = Fixe - 1
Writeeeprom Fixe , M
Waitms 200
End If
Goto Seting
Else
Cls
Home
Goto Main
End If
$regfile = "m16def.dat"
$crystal = 8000000
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pinb.5 , Db5 = Pinb.4 , Db6 = Pinb.3 , Db7 = Pinb.2 , E = Pinb.6 , Rs = Pinb.7
Config Portd = Input
Config Portc = Output
Dim M As Byte
Dim A As Byte
Dim B As Single
Dim C As Byte
Dim Fixe As Byte
Dim Inte As Bit
C = 0
A = 0
Readeeprom Fixe , M
Cls
Main:
Do
Start Adc
A = Getadc(0)
Stop Adc
C = A / 1.9
B = C / 100
Home
Lcd "kpa:" ; C ; " "
Locate 2 , 1
Lcd "BAR:"
Locate 2 , 6
Lcd Fusing(b , "#.&&" )
If Pind.2 = 1 Then
Goto Seting
End If
If Fixe < C Then
Reset Portc.0
If Inte = 0 Then
Inte = 1
Goto Full
End If
Else
Inte = 0
Set Portc.0
End If
Loop
End 'end program
زیر برنامه بیزر حالت تثبیت Full:
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Set Portc.1
Waitms 500
Reset Portc.1
Waitms 500
Goto Main
Seting:
Cls
If Pind.2 = 1 Then
Home
Lcd "fix kpa:" ; Fixe ; " "
If Pind.0 = 1 Then
Fixe = Fixe + 1
Writeeeprom Fixe , M
Waitms 200
End If
If Pind.1 = 1 Then
Fixe = Fixe - 1
Writeeeprom Fixe , M
Waitms 200
End If
Goto Seting
Else
Cls
Home
Goto Main
End If
دیدگاه