Sleep the CPU after first iteration, for sanity
This commit is contained in:
		
							parent
							
								
									008807d6cb
								
							
						
					
					
						commit
						bbaf73ef6e
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		
							
								
								
									
										3
									
								
								main.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								main.c
									
										
									
									
									
								
							|  | @ -8,6 +8,7 @@ | ||||||
| #define LED_PIN PB5  // Define the pin connected to the LED
 | #define LED_PIN PB5  // Define the pin connected to the LED
 | ||||||
| 
 | 
 | ||||||
| #include <avr/io.h> | #include <avr/io.h> | ||||||
|  | #include <avr/sleep.h> | ||||||
| #include <math.h> | #include <math.h> | ||||||
| #include <util/delay.h> | #include <util/delay.h> | ||||||
| 
 | 
 | ||||||
|  | @ -55,7 +56,7 @@ int main(void) { | ||||||
|         MPU6050_Read_Accel(accel_data); |         MPU6050_Read_Accel(accel_data); | ||||||
| 
 | 
 | ||||||
|         UART_println("Accelerometer (mg): X=%d, Y=%d, Z=%d", accel_data[0], accel_data[1], accel_data[2]); |         UART_println("Accelerometer (mg): X=%d, Y=%d, Z=%d", accel_data[0], accel_data[1], accel_data[2]); | ||||||
|         _delay_ms(1000); |         sleep_mode(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return 0; |     return 0; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus