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