Lite rotande i manualen gav det här:
Och det verkade ju smidigt. Problemet är att output-fönstret inte verkar vara stdout i det här fallet.Function name Purpose
printf(const char * s, ...) Formatted printing to stdout
Lite extra rotande i Hi-Techs FAQ gav det här:
Mycket riktigt, den PIC-kompilerade funktionen putch() är tom (innehåller endast "clrf STATUS; return"), så där tog det roliga slut eftersom att skriva en egen putch() skulle vara rätt döfött då det blir PIC-kod av det.Q. What does printf output to ?
A. The printf() function calls another function putch() to output
the character after formatting. By default putch() is defined
as an empty function. To allow printf() to write to a specific
output the putch() function needs to be redefined. In most cases
output is directed to the serial port. A sample definition can
be found in the serial.c file in the samples directory of the
compiler distribution for the PICC and PICC18 compilers.
Men jag vill fortfarande gärna ha debugutskrifter. Närmare bestämt så vill jag i en loop skriva ut ett par floats för att se om de håller sig inom rätt ramar. Provade då att dra upp watch-fönstret, men när jag hovrar mina float-värden så är värdena helt galna.
Kod: Markera allt
double Cx = 440e-12
Vet någon hur man går tillväga för att få printf() att skriva i output?