sprintf() from teensy lib?

jim lee

Well-known member
I have this code, runs wonderfully on teensy. I wanted to run it with the Wokwi simulation to show it off, but... Everything works except much of the string output is missing. Turns out sprintf() works on Teensy and it doesn't on the simulated Mega. This code I have, from the 70s & 80s, is sprinkled with sprintf() calls. Hundreds of them! Is there a way to add the sprintf() stuff as a library to my stuff? Is this doable? I've been rooting all through teesnsyDuino and I'm not finding anything that looks promising.

Thanks!

-jim lee
 
Never heard of that before ... Can code be added to the emulator?

You could always use this code: {local install}\hardware\teensy\avr\cores\teensy4\debugprintf.c
with edits to have a Teensy parse the source file for .printf( va_arg ) and have it spit out multiple source lines using .print().
 
Yeah, you can add Arduino libraries or your own. Even an sd card. Here is the code In talking about running in the simulator : https://wokwi.com/arduino/projects/320633653950415443

When you get listings of numbers all that comes up is question marks. (In real life running in my Teensy 3.2 it all works.)

I figure I could possibly paste in standard c lib? Or maybe this would be too involved.
 
Back
Top