Move sonar init function to main
This commit is contained in:
parent
98e9ccf3dd
commit
60aedbc945
@ -13,7 +13,7 @@
|
||||
#endif /* DEBUG */
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 1000000UL
|
||||
#define F_CPU 1000000UL // Stock atmega328p
|
||||
#endif
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ int main(void)
|
||||
{
|
||||
init_leds();
|
||||
init_servos();
|
||||
init_sonar();
|
||||
|
||||
run_servos();
|
||||
read_temp();
|
||||
|
@ -31,7 +31,6 @@ ISR(TIMER1_OVF_vect)
|
||||
int32_t read_sonar(void)
|
||||
{
|
||||
int dist_in_cm = 0;
|
||||
init_sonar();
|
||||
trigger_sonar();
|
||||
|
||||
// While echo pin is low
|
||||
|
Loading…
Reference in New Issue
Block a user