高价悬赏 高手把bascom转为c....
http://www.avrprojects.info/avr-projects/digital-dimmer-using-atmega8/ 这个是网站 以下是bascom语言 我用了bascom avr 可能软件没用 希望能转换以下 用avr studio完成编译 如果成功,悬赏美金:$50.00
$regfile = "m8def.dat"
$crystal = 4000000
Config Pinb.1 = Output ' Gate Triac
Config Pind.7 = Input ' Key Up
Config Pinb.0 = Input ' Key Dn
Config Int0 = Rising
On Int0 Int0_int ' Initialise the INT0 Interrupt
Enable Interrupts
Enable Int0
Dim E As Eram Byte
Dim B As Byte
Dim D As Byte
If E > 9 Then E = 9
B = E
D = 0
Set Portb.1
Do
If Pind.7 = 0 Then
If B > 0 Then Decr B
Waitms 10
E = B
End If
If Pinb.0 = 0 Then
If B < 9 Then Incr B
Waitms 10
E = B
End If
Loop
End ' end program
Int0_int:
Set Portb.1
For D = 0 To B
Waitus 200
Next D
Reset Portb.1
Return