Hallo alle, ich probiere gerade einen Code von C in BASCOM zu übersetzen. Der Code ist fürs Charlieplexing. Originalquelle hier: http://www.dgoersch.info/codesammlung/avr-gcc/50-charlieplexing Mein Problem ist nun die einzelne Steps. Wie übersetze ich das in BASCOM. Mein bisheriger Code sieht so aus:
1 | $regfile = "attiny2313.dat" |
2 | $hwstack = 32 |
3 | $swstack = 32 |
4 | $crystal = 8000000 |
5 | |
6 | Dim Chstep As Byte |
7 | Dim Temp As Byte |
8 | |
9 | Config Timer0 = Timer , Prescale = 1024 |
10 | On Timer0 Timerisr |
11 | |
12 | Enable Timer0 |
13 | Enable Interrupts |
14 | |
15 | |
16 | Do |
17 | |
18 | |
19 | |
20 | Loop |
21 | |
22 | Timerisr: |
23 | Temp = Bits(chstep) |
24 | |
25 | If Chstep = 0 Then |
26 | |
27 | |
28 | Elseif Chstep = 1 Then |
29 | |
30 | |
31 | Elseif Chstep = 2 Then |
32 | |
33 | |
34 | Elseif Chstep = 3 Then |
35 | |
36 | |
37 | Elseif Chstep = 4 Then |
38 | |
39 | |
40 | End If |
41 | Ddrb = Temp : Portb = Bits(chstep) |
42 | If Chstep = 5 Then |
43 | Chstep = 0 |
44 | Else |
45 | Chstep = Chstep + 1 |
46 | End If |
47 | Return |
48 | |
49 | End |
Wäre nett, wenn mir jmd. helfen könnte