Jason Chang
/
9v1
Add I2CSlave to ov580 master.
Diff: main.cpp
- Revision:
- 16:8d45d7451ffe
- Parent:
- 13:2b83989d136c
- Child:
- 17:908ca409cb33
--- a/main.cpp Thu Mar 07 05:03:12 2019 +0000 +++ b/main.cpp Mon Mar 11 01:20:43 2019 +0000 @@ -124,17 +124,17 @@ static float dot_zero_ms = 1; -static float dot_one_ms = 408; +static float dot_one_ms = 410; static float dot_two_ms = 354; -static float dot_three_ms = 326; -static float dot_four_ms = 308; -static float dot_five_ms = 295; +static float dot_three_ms = 294; +static float dot_four_ms = 294; +static float dot_five_ms = 294; static float flood_zero_ms = 1; -static float flood_one_ms = 609; -static float flood_two_ms = 542; -static float flood_three_ms = 507; -static float flood_four_ms = 484; -static float flood_five_ms = 468; +static float flood_one_ms = 610; +static float flood_two_ms = 420; +static float flood_three_ms = 270; +static float flood_four_ms = 270; +static float flood_five_ms = 270; /* THREAD */ EventQueue queue; @@ -210,7 +210,7 @@ char lm_off[2] = {enable_reg,disable_ir}; char lmSafety[2] = {configuration_reg,enable_flash_timeout}; -char data_read[6]; +//char data_read[6]; char flashBrightness_dot[2] = {brightness_reg,level_dot_max}; char flashBrightness_flood[2] = {brightness_reg,level_flood_max}; @@ -297,7 +297,7 @@ void write_dot() { flood_I2C.write(LM36011_addr,lm_off,2,false); - flood_check_status(); + //flood_check_status(); dot_I2C.write(LM36011_addr,lm_on,2,false); } @@ -305,7 +305,7 @@ void write_flood() { dot_I2C.write(LM36011_addr,lm_off,2,false); - dot_check_status(); + //dot_check_status(); flood_I2C.write(LM36011_addr,lm_on,2,false); } @@ -548,8 +548,8 @@ flashBrightness_dot[1] = level_dot_max; - //dot_I2C.write(LM36011_addr,flashBrightness_dot,2,false); - wait(.1); + dot_I2C.write(LM36011_addr,flashBrightness_dot,2,false); + wait(.01); if(flood_timer_number > 700 && flood_timer_number < 1499) { flood_current_setting = flood_one_ms; @@ -577,23 +577,11 @@ flashBrightness_flood[1] = level_flood_max; - //flood_I2C.write(LM36011_addr,flashBrightness_flood,2,false); - - wait(.1); + flood_I2C.write(LM36011_addr,flashBrightness_flood,2,false); - //read_fail = flood_I2C.read(LM36011_addr,data_read,6,false); - /* - if(read_fail) { - red = 0; - } else { - if(data_read[5] != 0) { - red = 0; - } else { - red = !red; - } - } - */ - + wait(.01); + + silego_check_status(); } }