Print out library files in C to the arduino serial monitor

Status
Not open for further replies.
Is there a way to print out variables in the C library files to the arduino serial monitor?
See below:

#if defined(FTM2_CH0_PIN)
} else if (pin == FTM2_CH0_PIN || pin == FTM2_CH1_PIN) {
cval = ((uint32_t)val * (uint32_t)(FTM2_MOD + 1)) >> analog_write_res;
#endif
#if defined(FTM3_CH0_PIN)
} else if (pin == FTM3_CH0_PIN || pin == FTM3_CH1_PIN || pin == FTM3_CH2_PIN
|| pin == FTM3_CH3_PIN || pin == FTM3_CH4_PIN || pin == FTM3_CH5_PIN
|| pin == FTM3_CH6_PIN || pin == FTM3_CH7_PIN) {
cval = ((uint32_t)val * (uint32_t)(FTM3_MOD + 1)) >> analog_write_res;
#endif
#if defined(TPM1_CH0_PIN)
} else if (pin == TPM1_CH0_PIN || pin == TPM1_CH1_PIN) {
cval = ((uint32_t)val * (uint32_t)(TPM1_MOD + 1)) >> analog_write_res;
#endif
} else {
cval = ((uint32_t)val * (uint32_t)(FTM0_MOD + 1)) >> analog_write_res;
}
serial_print("cval = ");
//serial_phex32(cval);
//serial_print("\n");
 
There should be plenty of examples showing this?

With something like this to make sure computer is online:
Code:
void setup() {
  Serial.begin(115200);
  while (!Serial && millis() < 5000 );
  Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);

// …
unit16_t foo = 32;
  Serial.print( foo );
  Serial.print( foo, HEX );

}
 
Status
Not open for further replies.
Back
Top