ben çok acemiyim elimdeki c ile yazılmış dosyayı bas dosyaına çevirip protonda hex çıkışı almak istediğimde şöyle bir hata veriyor:
error:[line 28] item threshold not found!(untitled.bas)
error:[line 29] item sensitivity not found!(untitled.bas)
.....
....
....
error:[line 49] item target not found!(untitled.bas)
kod şu şekilde: lütfen koddaki yalnış yeri gösterebilirmisiniz
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2020 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 12.04.2020 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
Device = 16F876A
Xtal = 4
Config XT_OSC,WDT_OFF,PWRTE_ON,BODEN_OFF,CP_OFF,CPD_OFF,LVP_OFF
Define LCD_Type = 0
Define LCD_DTPin PORTC.4
Define LCD_RSPin PORTC.0
Define LCD_ENPin PORTC.3
Define LCD_Lines 2
Define LCD_Interface 4
Define Adin_Res 10 ' 10-bit result required
Define Adin_Tad 32_FOSC ' AD conversion clock
Define Adin_Stime 20 ' 20us AD sample time
CCP1_Pin = PORTC.2
threshold As Byte
sensitivity As Byte
duty As Byte
sample1 As Word
sample2 As Word
sample3 As Word
sample4 As Word
gb1 As Word
gb2 As Word
gb3 As Word
gb4 As Word
s1 As Word
s2 As Word
s3 As Word
s4 As Word
temp1 As Float
temp2 As Float
temp3 As Float
battery_voltage As Float
target As Word
size As Word
i As Byte
PORTB_Pullups = On
ADCON1 = $84
TRISA = $0B
TRISB = $FF
TRISC = $00
DelayUS 500
Clear 'Clear variables
Print $FE, 1 'Clear display
duty = 10
threshold = 2
DelayUS 500
Print $FE, 1, "** BRN Pi-1 **"
Print $FE, $C0, "Digital Detector"
DelayMS 2000
Print $FE, 1, "Made in TURKEY"
Print $FE, $C0, " ** Baron66 ** "
DelayMS 2000
Print $FE, 1
While 1 = 1
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 10
sample1 = ADIn 0
DelayUS 790
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 50
sample2 = ADIn 0
DelayUS 750
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 90
sample3 = ADIn 0
DelayUS 710
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 150
sample4 = ADIn 0
DelayUS 650
temp1 = ADIn 1
temp2 = temp1 * 0.0048
temp3 = temp2 * 110
battery_voltage = temp3 / 10 + 0.3
'Ground
If PORTB.0 = 0 Then GoSub GroundBalance
'Sound+
If PORTB.2 = 0 Then
duty = duty + 10
If duty > 100 Then duty = 100
GoSub Beep
End If
'Sound-
If PORTB.1 = 0 Then
duty = duty - 10
If duty < 0 Then duty = 0
GoSub Beep
End If
'Sens-
If PORTB.3 = 0 Then
GoSub Beep
threshold = threshold + 10
If threshold > 100 Then threshold = 100
End If
'Sens+
If PORTB.4 = 0 Then
GoSub Beep
threshold = threshold - 10
If threshold < 0 Then threshold = 0
End If
sensitivity = (100 - threshold) / 10
GoSub Calculate
Print $FE, $80, "V:", Dec duty / 10, " "
Print $FE, $84, "S:", Dec sensitivity, " "
If 10.3 < battery_voltage Then
Print $FE, $88, "B:", Dec2 battery_voltage, "V "
Else
Print $FE, $88, "B:LOW "
End If
If target > threshold Then
HPWM 1,duty,1260 'Sound On
size = target / 10
If size > 15 Then size = 15
For i = 0 To size
Print $FE, $C0 + i, ".>---------------"
Next
Else
Print $FE, $C0, "--------------"
HPWM 1,0,0 'Sound Off
End If
Wend
GroundBalance:
gb1 = sample1 + 2
gb2 = sample2 + 2
gb3 = sample3 + 2
gb4 = sample4 + 2
DelayMS 150
Return
Calculate:
s1 = sample1 - gb1
s2 = sample2 - gb2
s3 = sample3 - gb3
s4 = sample4 - gb4
If s1 < 0 Then s1 = 0
If s2 < 0 Then s2 = 0
If s3 < 0 Then s3 = 0
If s4 < 0 Then s4 = 0
target = s4 + s1 + s2 + s3
Return
Beep:
HPWM 1,duty,1260
DelayMS 150
HPWM 1,0,0
Return
Syntax hataları var, düzeltilmişi altta.
Kod'un doğru hazırlanıp hazırlanmadığını bilemem.
derledikten sonraki hex de altta
Device = 16F876A
Xtal = 4
Config XT_OSC,WDT_OFF,PWRTE_ON,BODEN_OFF,CP_OFF,CPD_OFF,LVP_OFF
Declare LCD_Type = 0
Declare LCD_DTPin PORTC.4
Declare LCD_RSPin PORTC.0
Declare LCD_ENPin PORTC.3
Declare LCD_Lines 2
Declare LCD_Interface 4
Declare Adin_Res 10 ' 10-bit result required
Declare Adin_Tad 32_FOSC ' AD conversion clock
Declare Adin_Stime 20 ' 20us AD sample time
Declare CCP1_Pin = PORTC.2
Dim threshold As Byte
Dim sensitivity As Byte
Dim duty As Byte
Dim sample1 As Word
Dim sample2 As Word
Dim sample3 As Word
Dim sample4 As Word
Dim gb1 As Word
Dim gb2 As Word
Dim gb3 As Word
Dim gb4 As Word
Dim s1 As Word
Dim s2 As Word
Dim s3 As Word
Dim s4 As Word
Dim temp1 As Float
Dim temp2 As Float
Dim temp3 As Float
Dim battery_voltage As Float
Dim target As Word
Dim size As Word
Dim i As Byte
Declare PORTB_Pullups = On
ADCON1 = $84
TRISA = $0B
TRISB = $FF
TRISC = $00
DelayUS 500
Clear 'Clear variables
Print $FE, 1 'Clear display
duty = 10
threshold = 2
DelayUS 500
Print $FE, 1, "** BRN Pi-1 **"
Print $FE, $C0, "Digital Detector"
DelayMS 2000
Print $FE, 1, "Made in TURKEY"
Print $FE, $C0, " ** Baron66 ** "
DelayMS 2000
Print $FE, 1
While 1 = 1
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 10
sample1 = ADIn 0
DelayUS 790
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 50
sample2 = ADIn 0
DelayUS 750
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 90
sample3 = ADIn 0
DelayUS 710
TRISA.5 = 0
PORTA.5 = 1
DelayUS 200
TRISA.5 = 0
PORTA.5 = 0
DelayUS 150
sample4 = ADIn 0
DelayUS 650
temp1 = ADIn 1
temp2 = temp1 * 0.0048
temp3 = temp2 * 110
battery_voltage = temp3 / 10 + 0.3
'Ground
If PORTB.0 = 0 Then GoSub GroundBalance
'Sound+
If PORTB.2 = 0 Then
duty = duty + 10
If duty > 100 Then duty = 100
GoSub Beep
End If
'Sound-
If PORTB.1 = 0 Then
duty = duty - 10
If duty < 0 Then duty = 0
GoSub Beep
End If
'Sens-
If PORTB.3 = 0 Then
GoSub Beep
threshold = threshold + 10
If threshold > 100 Then threshold = 100
End If
'Sens+
If PORTB.4 = 0 Then
GoSub Beep
threshold = threshold - 10
If threshold < 0 Then threshold = 0
End If
sensitivity = (100 - threshold) / 10
GoSub Calculate
Print $FE, $80, "V:", Dec duty / 10, " "
Print $FE, $84, "S:", Dec sensitivity, " "
If 10.3 < battery_voltage Then
Print $FE, $88, "B:", Dec2 battery_voltage, "V "
Else
Print $FE, $88, "B:LOW "
End If
If target > threshold Then
HPWM 1,duty,1260 'Sound On
size = target / 10
If size > 15 Then size = 15
For i = 0 To size
Print $FE, $C0 + i, ".>---------------"
Next
Else
Print $FE, $C0, "--------------"
HPWM 1,0,0 'Sound Off
End If
Wend
GroundBalance:
gb1 = sample1 + 2
gb2 = sample2 + 2
gb3 = sample3 + 2
gb4 = sample4 + 2
DelayMS 150
Return
Calculate:
s1 = sample1 - gb1
s2 = sample2 - gb2
s3 = sample3 - gb3
s4 = sample4 - gb4
If s1 < 0 Then s1 = 0
If s2 < 0 Then s2 = 0
If s3 < 0 Then s3 = 0
If s4 < 0 Then s4 = 0
target = s4 + s1 + s2 + s3
Return
Beep:
HPWM 1,duty,1260
DelayMS 150
HPWM 1,0,0
Return
:10000000000004308A00222CA401AD00AE01A01132
:1000100024080319A0150530A3002730AA001030CA
:100020001D200330AA00E8301D20AA0164301D20E5
:10003000AA010A301D202D082428A9002E08A60098
:100040002D08A500DC212508A500A3030319A01194
:10005000240803192E282302031835282508031D18
:10006000A011A0193528303E0A290800C900BA1F7E
:100070003B282D300A21BC0F4228BB0F4228BA0A68
:100080000319BA0AC101C201C301C401BA176A3017
:10009000B9070310BA0CBB0CBC0CC40CC30CC20CCB
:1000A000C10CB90F49283C083902BC07B9023B080A
:1000B0003A02BB07BA02A40195202E300A21CA01D8
:1000C0000310410DBC00420DBB00430DBA00440DAE
:1000D000B900CA0D0310BC0DBB0DBA0DB90DCA0D88
:1000E0004108BC0742080318420FBB074308031826
:1000F000430FBA0744080318440FB9070318CA0F7F
:100100000310BC0DBB0DBA0DB90DCA0D4A08303E27
:100110000A213C08C1003B08C2003A08C300390864
:10012000C400C90B5F2803100E2AA0112408031D68
:100130009C28A0150A30A4003C08A8003B08A70092
:100140003A08A6003908A500A301B001AF01AE012D
:100150000A30AD00A321A30A23082402031DA52809
:100160002D08031DA011A01DB728240BBA282D08A7
:10017000303E0A21A40B9C280E2AB20087110710DA
:100180008316871107100F30870583123208A018D5
:10019000E7283E30A60080308F213330B100FB20AD
:1001A0001330A60088308F21FB2064308E21FB2085
:1001B00064308E212230B100FB202830E6200C3044
:1001C000E6200630E620A0143208E7282014B1000B
:1001D000201CF5280710033C031CFA28FA200730DE
:1001E000A600D0308F21031408002014FE3C031910
:1001F00008290714201C201087150F3087053108A7
:10020000F03987048711B10E2018FB2832308E2177
:1002100032080E2AA11BBD280800B4004230A500F8
:100220000F30A600DC2103191210031D1214FC3E2E
:10023000031C9210031892144030A5004230A6000F
:100240000F30AD00AE011218452192184521DE2174
:1002500025038316920083122508A9002608AA0008
:100260002208B100B200220FB201F8212E08B40B0F
:10027000452995000C309700AD1B97162D1B1716BE
:1002800083160711831212150E2A46210310AD0C96
:10029000A60CA50C0800A300CB01230803178D00B2
:1002A0000313240803178F005E2103190E2A0A2165
:1002B000A30A0319A40ACB0F4D290E2A831603178C
:1002C0008C170C140000000083120C080E2AB100D9
:1002D000B10DB10D310D3839C1389F0014308E2168
:1002E0001F151F1971291E08BA0083161E088312D4
:1002F000B9000E2A83178001840AFF3E031D7B2963
:100300000E2AAA01A900FF30A907031CAA07031C93
:100310000E2A0330A600DF308F218329A601E83E94
:10032000A500A609FC30031C9829A50703189529E8
:10033000A5070000A60F952925189E29A51CA2290E
:100340000000A2290800BD01BE01BF01C00121308B
:10035000AB00CA29BD0DBE0DBF0DC00D2D083D025D
:100360002E08031C2E0F3E022F08031C2F0F3F02E6
:100370003008031C300F4002031CCA29C0002D089E
:10038000BD022E08031C2E0FBE022F08031C2F0FC8
:10039000BF020314A50DA60DA70DA80DAB0BAA292E
:1003A0004008B0003F08AF003E08AE003D08AD0079
:1003B0000E2AA601AA01A900AE01AD011030B100BC
:1003C000260DAD0DAE0D2908AD022A08031C2A0F1B
:1003D000AE020318F2292908AD072A0803182A0FCC
:1003E000AE070310A50DA60DB10BE02925080800E6
:1003F0001030B800A601A501B20CB10C031C062AEE
:100400002908A5072A0803182A0FA607A60CA50C79
:10041000AE0CAD0CB80BFC292D0808008313831219
:100420000313080046084206CF00CF1B472AC61B0D
:10043000302A45084102031C0034031D01344608DC
:100440004202031C0034031D013447084302031C0D
:100450000034031D013448084402031C00340134F5
:1004600041084502031C0034031D013442084602C2
:10047000031C0034031D013443084702031C0034ED
:10048000031D013444084802031C00340134C21F18
:100490000134003445084102C9000318692AC9091A
:1004A000C90A4108CE004508C1004E08C5004208EF
:1004B000CE004608C2004E08C6004308CE004708DA
:1004C000C3004E08C7004408CE004808C4004E08C8
:1004D000C8001A30490203180E2AC50803190E2A4B
:1004E000BD014208CE004606CD00C217C61708302F
:1004F000C902031C832A4808BD004708C8004608F3
:10050000C700C601772AC90703198F2A0310C60C32
:10051000C70CC80CBD0CC903C908031D862ACD1F12
:10052000D62A4808C4024708031C470FC3024608DE
:10053000031C460FC2020318A72AC209C309C40933
:10054000C40FA52AC30A0319C20A8030CE06BD090A
:10055000BD0A0319B22AC403440FB22AC303430AD3
:100560000319C2030430C900C208031DC62A430888
:10057000C2004408C3003D08C400BD010830C102E8
:10058000031CF52AC9030319F52AB42AC21BD12A70
:100590000310BD0DC40DC30DC20DC1030319F52A0F
:1005A000C62ABD1FD52ABD01EB2AF42A4808C40774
:1005B00047080318470FC30746080318460FC2072A
:1005C000031CE92AC20CC30CC40CBD0CC10A0319DC
:1005D000F72ABD1FF42AC40FF42AC30FF42AC20F4E
:1005E000F42A03144110E22AFE2AC101FA2ACC1689
:1005F000FF30C100C401C3018030C200CE1B012BFB
:10060000C2130E2A4208BF004606CD00C5080319D2
:100610006A2BC10803196D2B4508C1027F300318EE
:10062000152BC107031C6C2B182BC10703186F2B4C
:100630004408BD004308BE00BF17C6171830CE00DF
:10064000C401C301C201262B0318322B48083D0206
:100650004708031C470F3E024608031C460F3F0293
:10066000031C3D2B4808BD024708031C470FBE0270
:100670004608031C460FBF020314C40DC30DC20D70
:10068000BD0DBE0DBF0DCE0B242BC21B4F2BC108C1
:1006900003196C2BCD0CC103CE0ACD0D242B0318EE
:1006A0005D2B4808BD024708031C470FBE024608E1
:1006B000031C460FBF02031C692BC40F692BC30F19
:1006C000692BC20F692BC20CC30CC40CC10A0319DD
:1006D0006F2B762BCC15702B4C15C101722BCC14C3
:1006E000FF30C100C401C3018030C200CD1B792B93
:1006F000C2130E2A4208BF004606CD004108003A48
:10070000031D4508003A0319CA2BC1077E30031C9C
:100710008D2BC1020318CC2B902BC102031CC92BBB
:100720004408BD004308BE00BF17C617C401C3017B
:10073000C2011830CE00BF0CBE0CBD0C031CAA2B8E
:100740004808C40747080318470FC307460803189B
:10075000460FC207C20CC30CC40CCE0B9B2BC21B92
:10076000B92BC40DC30DC20DC1080319C92BC10398
:100770003F0D031CC82BC40FC82BC30FC82BC20FBF
:10078000C82B0314C20CC30CC40CC10A0319CC2B14
:10079000D32B4C15C101CF2BCC14FF30C100C401A9
:1007A000C3018030C200CD1BD62BC2130E2AC30159
:1007B000C401CD13EA2BCD13C41FEA2BC409C3090E
:1007C000C209C109C10FE92BC20FE92BC30A0319E2
:1007D000C40ACD179630CE00C4080319F82B083090
:1007E000CE074208C1004308C2004408C3000D2CD4
:1007F000C308031D0D2C0830CE024208031D092C2E
:100800000830CE024108031D082C4408CE00172CE6
:10081000C101C3004108C200C101C31B152C031054
:10082000C10DC20DC30DCE030D2CCD1FC313410846
:10083000C4004E08C1004308CE004208C3004E0861
:10084000C2000E2A83014030CC00A001073083167D
:100850009F009C00811384309F000B308500FF3087
:100860008600870101308312A600F4308A018F21AF
:100870002030840060308A017B21A0308400503019
:100880008A017B211030840060308A017A21903007
:10089000840060308A017A21FE308A01BD20013057
:1008A0008A01BD200A30D2000230D0000130A600FB
:1008B000F4308A018F21FE308A01BD2001308A0187
:1008C000BD208030A1000730A4003D308A014B21BB
:1008D000FE308A01BD20C0308A01BD208030A100D9
:1008E0000730A4004E308A014B210730AA00D030D7
:1008F0008A018221FE308A01BD2001308A01BD209B
:100900008030A1000730A4005F308A014B21FE3007
:100910008A01BD20C0308A01BD208030A10007308F
:10092000A4006F308A014B210730AA00D0308A0121
:100930008221FE308A01BD2001308A01BD2083164C
:10094000851283128516C8308A018E21831685127E
:10095000831285120330A5008A110A12A50BAE2C52
:10096000000000308A016721D3003A08D400033028
:10097000A60016308A018F218316851283128516F0
:10098000C8308A018E218316851283128512323077
:100990008A018E2100308A016721D5003A08D600ED
:1009A0000230A600EE308A018F2183168512831251
:1009B0008516C8308A018E2183168512831285120E
:1009C0005A308A018E2100308A016721D7003A0807
:1009D000D8000230A600C6308A018F218316851206
:1009E00083128516C8308A018E21831685128312E0
:1009F000851296308A018E2100308A016721D90044
:100A00003A08DA000230A6008A308A018F210130CC
:100A10008A0167213A08C2003908C1008A01D72338
:100A20004408EE004308ED004208EC004108EB00EA
:100A30005230C4004930C3001D30C2007730C100BD
:100A40006E08C8006D08C7006C08C6006B08C500BA
:100A50008A017A234408F2004308F1004208F000BA
:100A60004108EF00C401C3015C30C2008530C10001
:100A70007208C8007108C7007008C6006F08C5007A
:100A80008A017A234408F6004308F5004208F4007E
:100A90004108F300C801C7012030C6008230C500FC
:100AA0007608C4007508C3007408C2007308C1004A
:100AB0008A0102234408BC004308BB004208BA0074
:100AC0004108B9009A30C4009930C3001930C200FF
:100AD0007D30C1003C08C8003B08C7003A08C6008A
:100AE0003908C5008A014A224408FA004308F9007F
:100AF0004208F8004108F7008A110A120618832DEF
:100B00008A110A12B7268A110A120619942D0A3080
:100B1000D207653052028A110A12031C912D6430EB
:100B2000D2008A110A1228278A110A128618A22DC9
:100B30000A30D2028A110A12D21F9F2DD2018A11C5
:100B40000A1228278A110A128619B32D8A110A124D
:100B500028270A30D007653050028A110A12031C78
:100B6000B32D6430D0008A110A12061AC12D8A11E1
:100B70000A1228270A30D0028A110A12D01FC12D6A
:100B8000D0015008643CB9000030031CFF3EBA009D
:100B90003A08A6003908A500AA010A30A9008A016E
:100BA000DC21D1008A110A12D726FE308A01BD202D
:100BB00080308A01BD2056308A01BD203A308A013A
:100BC000BD208030A100A4015208A5000A308A018E
:100BD000D921AD00AE018A01072020308A01BD2055
:100BE000FE308A01BD2084308A01BD2053308A0145
:100BF000BD203A308A01BD208030A10051088A0111
:100C0000042020308A01BD20CD30C400CC30C30088
:100C10002430C2008230C1007A08C8007908C700B9
:100C20007808C6007708C5008A011222013C8A11A3
:100C30000A1203193D2EFE308A01BD2088308A0138
:100C4000BD2042308A01BD203A308A01BD2080306B
:100C5000A1007A08BC007908BB007808BA007708C0
:100C6000B90002308A01362056308A01BD2020307A
:100C70008A01BD208A110A124A2EFE308A01BD2047
:100C800088308A01BD208030A1000730A4007F3069
:100C90008A014B21FC088A110A12031D552E7B087C
:100CA00050028A110A120318A22E8312031352084B
:100CB000A2000430AA00EC30A90001308A010D2105
:100CC0007C08A6007B08A500AA010A30A9008A01B9
:100CD000DC21FD002608FE00FE088A110A12031D11
:100CE000772E10307D028A110A12031C7C2E83128B
:100CF0000313FE010F30FD00FF01FE088A110A12E6
:100D0000031D882E7F087D028A110A12031C9F2E64
:100D1000FE30831203138A01BD20C0307F07AD006F
:100D20008A01BD208030A1000730A40087308A01ED
:100D30004B210130FF078A110A12031C7D2E8A11F4
:100D40000A12B52EFE308A01BD20C0308A01BD20B6
:100D50008030A1000730A40099308A014B21A20104
:100D6000AA01A90101308A010D218A019F2C0230BC
:100D70005307DB0054080318013EDC00023055071E
:100D8000DD0056080318013EDE0002305707DF0081
:100D900058080318013EE00002305907E1005A08E4
:100DA0000318013EE20096308A01812108005B08A9
:100DB0005302E3005C08031C013E5402E4005D089A
:100DC0005502E5005E08031C013E5602E6005F087E
:100DD0005702E7006008031C013E5802E800610862
:100DE0005902E9006208031C013E5A02EA008A1116
:100DF0000A12E41FFD2EE401E3018A110A12E61F24
:100E0000032FE601E5018A110A12E81F092FE80104
:100E1000E7018A110A12EA1F0F2FEA01E9016A08A5
:100E2000BA006908B9006308B90764080318013EED
:100E3000BA076508B90766080318013EBA073908FA
:100E40006707FB003A080318013E6807FC0008002A
:100E50005208A2000430AA00EC30A90001308A0137
:100E60000D2196308A018121A201AA01A901013038
:100E70008A010D2108008A013B2F2A002A00200048
:100E80002000420052004E002000500069002D005A
:100E90003100200020002A002A00000044006900E0
:100EA00067006900740061006C0020004400650068
:100EB00074006500630074006F00720000004D0054
:100EC000610064006500200069006E0020002000C1
:100ED0005400550052004B0045005900000020000E
:100EE0002A002A0020004200610072006F006E009C
:100EF0003600360020002A002A00200000004200B0
:100F00003A004C004F0057002000200000002E0047
:100F10003E002D002D002D002D002D002D002D0058
:100F20002D002D002D002D002D002D002D002D0059
:100F300000002D002D002D002D002D002D002D0076
:100F40002D002D002D002D002D002D002D00000066
:02400E00313F40
:00000001FF