![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ft. button press reset
Fork of BeaconDemo_RobotCode by
Diff: PsiSwarm/i2c.cpp
- Revision:
- 10:1b09d4bb847b
- Parent:
- 7:ef9ab01b9e26
--- a/PsiSwarm/i2c.cpp Mon Oct 26 11:16:05 2015 +0000 +++ b/PsiSwarm/i2c.cpp Mon Oct 26 23:58:08 2015 +0000 @@ -25,6 +25,12 @@ char test; +char get_dc_status() +{ + IF_read_aux_ic_data(); + return status_dc_in; +} + void IF_set_IR_emitter_output(char emitter, char state) { if(emitter <3) { @@ -224,8 +230,13 @@ write_data[0] = 0x09; primary_i2c.write(AUX_IC_ADDRESS,write_data,1,false); primary_i2c.read(AUX_IC_ADDRESS,read_data,1,false); - - pc.printf("Aux IC Data:%X\n",read_data[0]); + char old_charging_state = status_dc_in; + status_dc_in = 1-((read_data[0] & 0x10) >> 4); + if(status_dc_in!=old_charging_state){ + if(status_dc_in == 0)debug("No DC input\n"); + else debug("DC input to charge pins\n"); + } + //pc.printf("Aux IC Data:%X Charge:%d\n",read_data[0],charge_in); } void IF_parse_gpio_byte0(char byte)