Shop OBEX P1 Docs P2 Docs Learn Events
Data Display — Parallax Forums

Data Display

I would like to use SimpleIDE to display alpha numeric information on a computer screen. The data will consist of alpha (Temperature, Pressure, Time, Humidity, etc.) and numeric (123.456). Is there a directory of commands in C available that I can use to place this data on the screen in various locations? if so, how can I acquire it for compiling in SimpleIDE?

The data will be generated by a propeller.

Sincerely,

Discovery

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    If you're going to use a computer screen that implies a VGA monitor. Have a look at the VGATEXT.h reference in the SimpleIDE Library Reference section.
  • I could interpret "display ... info on a computer screen" as "send over UART/serial/rs232 connection to a PC and have the PC print to a terminal". If that's the case, Simple library's "print" function will work great for you. Very similar to libc's printf, you get access to print strings, integers, and even floats. Unlike libc's printf, it is optimized for the Propeller's limited memory.
    #include <simpletools.h>
    
    void main () {
      float temp = 20.1;
      int hour = 16;
      int minute = 9;
    
      print("Temp = %2.3f C\n", temp);
      print("Time = %2d:%02d %s\n", hour % 12, minute, hour > 12 ? "pm" : "am");
    }
    

    This would print to the terminal on your computer:
    Temp = 20.1 C
    Time =  4:09 pm
    
  • Or 'print' it into a format that you can easily parse in a program running on the computer, so you can receive the data and use it any way you want.
Sign In or Register to comment.