Update user_code.cpp
This commit is contained in:
		
							parent
							
								
									576abc1c90
								
							
						
					
					
						commit
						44ccee7903
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -1,21 +1,21 @@
 | 
				
			||||||
#include <user_code.hpp>
 | 
					#include <user_code.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void timer1_callback(){
 | 
					void timer1_callback()
 | 
				
			||||||
    for(int i=0;i<16;i++){
 | 
					{
 | 
				
			||||||
        pwm_set_state(i,1);
 | 
					    for (int i = 0; i < 16; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        pwm_set_state(i, 1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ESPMega_Timer timer1(0,50,timer1_callback,15001);
 | 
					ESPMega_Timer timer1(0, 50, timer1_callback, 15001);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
This Code will run right after ESPMega PRO's
 | 
					This Code will run right after ESPMega PRO's
 | 
				
			||||||
Peripheral Initialization Routine
 | 
					Peripheral Initialization Routine
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					 | 
				
			||||||
void user_pre_init()
 | 
					void user_pre_init()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,8 @@ This code will run every 15 seconds
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
void timer_tick_callback()
 | 
					void timer_tick_callback()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if(standalone){
 | 
					    if (standalone)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
        timer1.loop();
 | 
					        timer1.loop();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue