parent
							
								
									468fdfb2ca
								
							
						
					
					
						commit
						a7d780eaf5
					
				| 
						 | 
					@ -1,3 +1,8 @@
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
#include "tm4c123gh6pm.h"
 | 
					#include "tm4c123gh6pm.h"
 | 
				
			||||||
 | 
					// Global Variables
 | 
				
			||||||
 | 
					volatile int duty = 50; // Initial duty cycle
 | 
				
			||||||
 | 
					volatile bool buttonPressed = false; // Track button state
 | 
				
			||||||
 | 
					volatile uint32_t pressDuration = 0; // Track how long the button is pressed
 | 
				
			||||||
 | 
					const long int PWM_PERIOD = 1000000; // Period for 100kHz in microseconds (10ms)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue