Function addition between function.

Discussion in 'Embedded Systems and Microcontrollers' started by RRITESH KAKKAR, Feb 24, 2015.

  1. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hello,
    How to add function between this calling function...
    display(" Led ");
    unsigned char a=5; which will change reliquary
    how to add a variable between " suppose a"
    display(" a");

    thanks
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    What is a "reliquary"?

    What is a " suppose a"?

    You are welcome.
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,015
    You will need to be more clear. Your message makes no sense. Do you have someone to help you with English?

    E
     
  4. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hello,
    Sorry for incomplete meaning!
    OK, here are some code to display the Text on led matrix pixel.
    I need to add some more function(feature) to display outsourcing text/digit.

    clear();
    display(" Led "); // call display as Led is constant so, how to add variable stored in memory like temperature counter or something taken from serial data interface ?
    blit(1);






    display(char *str)
    {

    int addr;
    int z;
    while(*str!=0){
    addr = ((int)*str++ - 0x20);
    addr *= 5;
    int y=0;
    for(z=0;z<5;z++){
    leds[z] = Font2[addr+y];
    y++;
    }
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    While I could make a good guess at what you are not stating just list what type of variables (string, const string, int, const int, etc) you wish to display.

    And a hint at which compiler you use would be useful too.
     
  6. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,015
    Still no idea. What is " outsourcing"
     
  7. BobTPH

    Active Member

    Jun 5, 2013
    783
    114
    I think you want to convert a number to a string to display. the function itoa() will do this. Also, sprintf() can combing text and number into a string.

    Bob
     
  8. BobTPH

    Active Member

    Jun 5, 2013
    783
    114
    It is when we send our jobs to people who speak English as well as the OP.

    Bob
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,757
    4,800
    The problem here is that many standard library functions, particularly something like sprint() are extremely computationally expensive in an embedded system and may not even be provided in the libraries supplied with the compiler.

    Of course, it might help if the OP would tell us what compiler.
     
  10. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hello,
    The MP LAB IDE V8.87.
    actually DISPLAY will take char inside display( " all char alphabetizes/ constants" ) but i want to modify to have other number like if there is up/down counter to be display in matrix not in seven segment and we have to input source always not from compiling or loading chip we can go for serial communication usb to rs232 or blue tooth difff ways.
     
  11. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Which answers nothing about which compiler or variable types you use. Oh well... to

    To convert an integer type some compilers include a function called "itoa" as BobTPH mentioned. This converts an integer to an ASCII string.

    If your compiler did not include i just Google it and you will find lots of sample code.
     
  12. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    hi again,
    sorry for misunderstanding it is Hi tech C compilers.
    anyways, the display function only send char or numerical numbers i want to send the up down counter save in memory please tell which function to use?
     
  13. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,015
    Look up the itoa function.

    Or search on integer to ASCII fund for C so yo can write your own function.
     
Loading...