Update main.c change to mA

fc-a
Alan Johnston 11 months ago committed by GitHub
parent 3a8169bfcb
commit c62859adb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2306,13 +2306,13 @@ void get_tlm_fc() {
source_bytes[0] = 0b00000001 ; // 10100000 10000001 01000001 10000001 10000001 source_bytes[0] = 0b00000001 ; // 10100000 10000001 01000001 10000001 10000001
source_bytes[1] = 0b10000010 ; source_bytes[1] = 0b10000010 ;
printf("Volt: %f Int: %d \n", voltage[map[BAT]], (unsigned int)(voltage[map[BAT]] * 1000)); // 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]] * 100)); // printf("Amps: %f Int: %d \n", current[map[BAT]], (unsigned int)(current[map[BAT]] * 1));
source_bytes[9] = 0xff & (((unsigned int)(voltage[map[BAT]] * 1000) >> 8)); source_bytes[9] = 0xff & (((unsigned int)(voltage[map[BAT]] * 1000) >> 8)); // mV
source_bytes[10] = 0xff & ((unsigned int)(voltage[map[BAT]] * 1000)); source_bytes[10] = 0xff & ((unsigned int)(voltage[map[BAT]] * 1000));
source_bytes[11] = 0xff & (((unsigned int)(current[map[BAT]] * 100) >> 8)); source_bytes[11] = 0xff & (((unsigned int)(current[map[BAT]] * 1) >> 8)); // mA
source_bytes[12] = 0xff & ((unsigned int)(current[map[BAT]] * 100)); source_bytes[12] = 0xff & ((unsigned int)(current[map[BAT]] * 1));
source_bytes[13] = 0xff & (((unsigned long int)reset_count >> 8)); source_bytes[13] = 0xff & (((unsigned long int)reset_count >> 8));
source_bytes[14] = 0xff & ((unsigned long int)reset_count); source_bytes[14] = 0xff & ((unsigned long int)reset_count);
source_bytes[50] = 0xff & ((unsigned long int)sequence >> 16); // Sequence number source_bytes[50] = 0xff & ((unsigned long int)sequence >> 16); // Sequence number

Loading…
Cancel
Save

Powered by TurnKey Linux.