Update main.c add hex print

fc-jy
Alan Johnston 11 months ago committed by GitHub
parent 9062dfb390
commit 66dc8f9adb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2307,14 +2307,16 @@ void get_tlm_fc() {
// source_bytes[1] = 0b10000010 ;
printf("Volt: %f Int: %d \n", voltage[map[BAT]], (unsigned int)(voltage[map[BAT]] * 1000));
printf("Amps: %f Int: %d \n", current[map[BAT]], (unsigned int)(current[map[BAT]] * 1));
// printf("Volt: %f Int: %d \n", voltage[map[BAT]], (unsigned int)(voltage[map[BAT]] * 1000));
// printf("Amps: %f Int: %d \n", current[map[BAT]], (unsigned int)(current[map[BAT]] * 1));
uint16_t x = (uint16_t)((voltage[map[PLUS_X]] + voltage[map[MINUS_X]]) * 1000);
uint16_t y = (uint16_t)((voltage[map[PLUS_Y]] + voltage[map[MINUS_Y]]) * 1000);
uint16_t z = (uint16_t)((voltage[map[PLUS_Z]] + voltage[map[MINUS_Z]]) * 1000);
uint16_t b = (uint16_t)(voltage[map[BAT]] * 1000);
printf("X %x Y %x Z %x B %x\n", x, y, z, b);
source_bytes[FC_EPS + 0] = 0xff & (x >> 8); // mV
source_bytes[FC_EPS + 1] = 0xfd & (x << 0);

Loading…
Cancel
Save

Powered by TurnKey Linux.