Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: sprintf() from teensy lib?

  1. #1
    Senior Member jim lee's Avatar
    Join Date
    Dec 2016
    Location
    Anacortes, WA
    Posts
    180

    sprintf() from teensy lib?

    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

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,553
    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\debugpr intf.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().

  3. #3
    Senior Member jim lee's Avatar
    Join Date
    Dec 2016
    Location
    Anacortes, WA
    Posts
    180
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •