Skip to content

Commit

Permalink
ToF, Gyro, Bluetooth, OpenMV working ! Bluetooth Baud = 230400
Browse files Browse the repository at this point in the history
added execution speed measure function
  • Loading branch information
Ramith Hettiarachchi committed May 14, 2019
1 parent 31bbfd0 commit 9bd4691
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions source-code/LICRAWM 1.5.4 - Software/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <VL53L0X.h>
#include <MPU6050_tockn.h>


_led LED5(LED_5);
_led LED1(LED_1);
_led LED3(LED_3);
Expand All @@ -22,27 +23,40 @@ MPU6050 mpu6050(Wire);


void setup() {
Serial2.begin(9600);
Serial2.begin(230400);
//Serial2.setTimeout(100);
Serial3.begin(9600);
boot();
Wire.begin();
LED2.on();
LED1.on();

boot_gyro();
LED4.on(); //booting gyro done!
LED3.on(); //booting gyro done!
boot_tof();
LED1.on(); //booting tof done!
LED5.on(); //booting tof done!

}

void loop(){

bluetooth_input_check();
openmv_digital_decode();

print_tof_reading();

mpu6050.update();
print_gyro_reading();
unsigned long start = micros();


//TraceFunc();
bluetooth_input_check();
//openmv_digital_decode();

get_tof_reading();

get_gyro_reading();

unsigned long end = micros();
unsigned long delta = end - start;

if(DEBUG_SPEED){
Serial2.print("\n -> Loop ran in ");
Serial2.print(delta);
Serial2.print("ns \n");
}

}

0 comments on commit 9bd4691

Please sign in to comment.