|
|
View previous topic :: View next topic |
Author |
Message |
Jody
Joined: 08 Sep 2006 Posts: 182
|
fprintf and usb_cdc_putc stream |
Posted: Tue Aug 23, 2022 1:21 am |
|
|
Hello,
What I am trying to do:
Send a string and a variable to the usb.
PIC send and receive single strings.. when using the printf command i.e.: Code: | printf(usb_cdc_putc,"Tel_Temp 1 number :); |
this working ..
but when i do this:
Code: | fprintf(usb_cdc_putc,"Tel_Temp 1 number : %s", tel_temp1); |
the compiler complains: Stream must be a constant in the valid range .
And I don't understand what the problem is..
When I use the same command to a different stream it is fine...
so this goes with no problem: Code: | fprintf(RS232,"Tel_Temp 1 number : %s\n", tel_temp1) |
what am I doing wrong??
Best regards,
Jody |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Tue Aug 23, 2022 10:32 am |
|
|
fprint, prints to streams.
usb_cdc_putc, is _not_ a stream. It is a output function for the usb.
You don't want to be using the stream function. Just:
Code: |
printf(usb_cdc_putc,"Tel_Temp 1 number : %s", tel_temp1);
|
printf, can write to any output function. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|