'Mac_Dimm
'Laesst eine LED an PB4 ein- und ausatmen
'Arne Groh
'2011-06-20
'
'Fusebits
'1111 1111
'1111 1111
'1101 1111
'1110 0100
$regfile = "attiny2313.dat"
$crystal = 8e6
Dim I As Byte
Dim Ocr1b As Word
'Fast PWM-Mode 15 einstellen
Tccr1a = &B1010_0011
Tccr1b = &B0001_1001
'niedrigste Frequenz einstellen (damit man das PWM voll ausreizen kann)
Ocr1ah = &HFF : Ocr1al = &HFF
'OC1B als Output (PB4)
Set Ddrb.4
'Globale Interrupts aktivieren
Set Sreg.7
Do
'Einatmen
For I = 0 To 255 Step 1
Ocr1b = Lookup(i , Fade256)
'Tastverhaeltniss einstellen
Ocr1bh = High(ocr1b) : Ocr1bl = Ocr1b
Waitms 13
Next I
'Verharren
Waitms 150
'Ausatmen
For I = 255 To 0 Step -1
Ocr1b = Lookup(i , Fade256)
'Tastverhaeltniss einstellen
Ocr1bh = High(ocr1b) : Ocr1bl = Ocr1b
Waitms 8
Next I
'Verharren
Waitms 400
loop
'--------------------PWM DATA----------------------------
'(
Fade64:
Data 0% , 1% , 1% , 1% , 2% , 2% , 3% , 3%
Data 4% , 5% , 6% , 7% , 8% , 10% , 12% , 14%
Data 17% , 20% , 24% , 28% , 34% , 40% , 48% , 57%
Data 68% , 82% , 97% , 116% , 138% , 165% , 197% , 234%
Data 280% , 333% , 398% , 474% , 565% , 674% , 804% , 959%
Data 1143% , 1363% , 1625% , 1938% , 2311% , 2756% , 3287% , 3920%
Data 4674% , 5574% , 6647% , 7926% , 9452% , 11271% , 13440% , 16027%
Data 19112% , 22791% , 27178% , 32409% , 38648% , 46087% , 54958% , 65535%
')
Fade256:
Data 0% , 1% , 1% , 1% , 1% , 1% , 1% , 1% , 1% , 1% , 2% , 2% , 2% , 2% , 2% , 2%
Data 2% , 2% , 2% , 2% , 2% , 2% , 3% , 3% , 3% , 3% , 3% , 3% , 3% , 4% , 4% , 4%
Data 4% , 4% , 4% , 5% , 5% , 5% , 5% , 5% , 6% , 6% , 6% , 6% , 7% , 7% , 7% , 8%
Data 8% , 8% , 9% , 9% , 10% , 10% , 10% , 11% , 11% , 12% , 12% , 13% , 14% , 14% , 15% , 15%
Data 16% , 17% , 18% , 18% , 19% , 20% , 21% , 22% , 23% , 24% , 25% , 26% , 27% , 28% , 30% , 31%
Data 32% , 34% , 35% , 37% , 39% , 40% , 42% , 44% , 46% , 48% , 50% , 52% , 55% , 57% , 60% , 62%
Data 65% , 68% , 71% , 74% , 77% , 81% , 84% , 88% , 92% , 96% , 100% , 105% , 110% , 115% , 120% , 125%
Data 130% , 136% , 142% , 149% , 155% , 162% , 169% , 177% , 185% , 193% , 202% , 210% , 220% , 230% , 240% , 250%
Data 262% , 273% , 285% , 298% , 311% , 325% , 340% , 355% , 371% , 387% , 404% , 422% , 441% , 461% , 481% , 502%
Data 525% , 548% , 572% , 598% , 624% , 652% , 681% , 711% , 743% , 776% , 811% , 847% , 884% , 924% , 965% , 1007%
Data 1052% , 1099% , 1148% , 1199% , 1252% , 1308% , 1366% , 1427% , 1490% , 1556% , 1625% , 1698% , 1773% , 1852% , 1934% , 2020%
Data 2110% , 2204% , 2302% , 2404% , 2511% , 2623% , 2739% , 2861% , 2988% , 3121% , 3260% , 3405% , 3556% , 3714% , 3879% , 4052%
Data 4232% , 4420% , 4616% , 4822% , 5036% , 5260% , 5494% , 5738% , 5993% , 6259% , 6537% , 6828% , 7132% , 7449% , 7780% , 8125%
Data 8487% , 8864% , 9258% , 9669% , 10099% , 10548% , 11017% , 11507% , 12018% , 12552% , 13110% , 13693% , 14302% , 14938% , 15602% , 16295%
Data 17020% , 17776% , 18566% , 19392% , 20253% , 21154% , 22094% , 23076% , 24102% , 25173% , 26292% , 27461% , 28682% , 29957% , 31288% , 32679%
Data 34132% , 35649% , 37234% , 38889% , 40617% , 42423% , 44308% , 46278% , 48335% , 50484% , 52728% , 55072% , 57520% , 60076% , 62747% , 65535%
Powered by vBulletin® Version 4.2.5 Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.