introduce polarity, use 30 sine values
This commit is contained in:
parent
9cdbf0a8e7
commit
b479b1416f
@ -15,7 +15,7 @@
|
||||
#include <isr_compat.h>
|
||||
|
||||
|
||||
#define NUM_OF_SINE_VALUES 20
|
||||
#define NUM_OF_SINE_VALUES 30
|
||||
|
||||
|
||||
volatile uint8_t pulseWidthIdx = 0;
|
||||
@ -27,20 +27,20 @@ ISR(TIMER1_A0, TA1_ISR_Ovrfl) {
|
||||
if (pulseWidthIdx == 0) {
|
||||
P2OUT |= BIT3;
|
||||
}
|
||||
if (pulseWidthIdx == 13) {
|
||||
if (pulseWidthIdx == (NUM_OF_SINE_VALUES / 3)) {
|
||||
P2OUT |= BIT4;
|
||||
}
|
||||
if (pulseWidthIdx == 26) {
|
||||
if (pulseWidthIdx == (NUM_OF_SINE_VALUES / 3 * 2)) {
|
||||
P2OUT |= BIT5;
|
||||
}
|
||||
} else {
|
||||
if (pulseWidthIdx == 0) {
|
||||
P2OUT |= BIT4;
|
||||
}
|
||||
if (pulseWidthIdx == 13) {
|
||||
if (pulseWidthIdx == (NUM_OF_SINE_VALUES / 3)) {
|
||||
P2OUT |= BIT3;
|
||||
}
|
||||
if (pulseWidthIdx == 26) {
|
||||
if (pulseWidthIdx == (NUM_OF_SINE_VALUES / 3 * 2)) {
|
||||
P2OUT |= BIT5;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user