brainmsp430
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
brainmsp430 [2016/01/06 21:07] – admin | brainmsp430 [2016/01/07 11:27] – admin | ||
---|---|---|---|
Line 8: | Line 8: | ||
volatile int j = 0; | volatile int j = 0; | ||
volatile int brainFq[] = { | volatile int brainFq[] = { | ||
- | | + | 15, |
- | 14, //2 | + | 12, |
- | 13, //3 | + | 14, |
- | 12, //4 | + | 11, |
- | | + | 10, |
- | 10, //6 | + | 9, |
- | 9, //7 | + | 8, |
- | 8, //8 | + | 7, |
- | 7, //9 | + | 6, |
- | 6, //10 | + | 5, |
- | 5, //11 | + | 4, |
- | 4, //12 | + | 7, |
- | 7, //13 | + | 6, |
- | 6, //14 | + | 5, |
- | 5, //15 | + | 4, |
- | 4, //16 | + | 7, |
- | 6, //17 | + | 6, |
- | 5, //18 | + | 5, |
- | 4, //19 | + | 4, |
- | 5, //20 | + | 5, |
- | 6, //21 | + | 6, |
- | 7, //22 | + | 7, |
- | 8, //23 | + | 8, |
- | 9, //24 | + | 9, |
- | 10, //25 | + | 12, |
- | 11, //26 | + | 10, |
- | 12, //27 | + | 11, |
- | 13, //28 | + | 12, |
- | 14, //29 | + | 15, |
- | 15, //30 | + | 12, |
}; | }; | ||
volatile int brainDuration[] = { | volatile int brainDuration[] = { | ||
- | 20, //1 | + | 10, |
- | 20, //2 | + | 5, |
- | 20, //3 | + | 15, |
- | 20, //4 | + | 10, |
- | 20, //5 | + | 10, |
- | 20, //6 | + | 10, |
- | 20, //7 | + | 10, |
- | 30, //8 | + | 12, |
- | 30, //9 | + | 5, |
- | 30, //10 | + | 4, |
- | 30, //11 | + | 15, |
- | 40, //12 | + | 5, |
- | 5, //13 | + | 5, |
- | 10, //14 | + | 5, |
- | 20, //15 | + | 10, |
- | 60, //16 | + | 15, |
- | 5, //17 | + | 5, |
- | 10, //18 | + | 5, |
- | 30, //19 | + | 5, |
- | 5, //20 | + | 5, |
- | 5, //21 | + | 5, |
- | 5, //22 | + | 5, |
- | 5, //23 | + | 10, |
- | 5, //24 | + | 10, |
- | 5, //25 | + | 10, |
- | 5, //26 | + | 5, |
- | 5, //27 | + | 5, |
- | 5, //28 | + | 15, |
- | 5, //29 | + | 5, |
- | 25, //30 | + | 30, |
}; | }; | ||
volatile int ArrayLength = 30; | volatile int ArrayLength = 30; | ||
Line 100: | Line 100: | ||
| | ||
j = CountByTime(brainDuration[j], | j = CountByTime(brainDuration[j], | ||
- | on = blinkms(FreqTime(brainFq[j])); | + | if (j < ArrayLength){ |
- | | + | on = blinkms(FreqTime(brainFq[j])); |
- | if (on){ | + | TA1CCR0 = FreqCycle(brainFq[j]+400, |
+ | if (on){ | ||
| | ||
- | } | + | } |
- | | + | else{ |
| | ||
- | } | + | } |
- | } | + | } |
+ | else{ | ||
+ | | ||
+ | | ||
+ | _BIS_SR(LPM3_bits); | ||
+ | } | ||
+ | } | ||
| | ||
} | } | ||
Line 133: | Line 140: | ||
if (CurrentMillis - PreviousMillis >= Millis){ | if (CurrentMillis - PreviousMillis >= Millis){ | ||
PreviousMillis = CurrentMillis; | PreviousMillis = CurrentMillis; | ||
- | if (back < ArrayLength) back++; | + | if (back <= ArrayLength) back++; |
} | } | ||
return back; | return back; | ||
Line 169: | Line 176: | ||
P1OUT ^= 0x08; // Toggle output P1.3 | P1OUT ^= 0x08; // Toggle output P1.3 | ||
} | } | ||
+ | |||
</ | </ |
brainmsp430.txt · Last modified: 2019/08/06 15:11 by admin