How do i make the Thermometer capture from temperture

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhavesh1978
    New Member
    • Mar 2007
    • 32

    How do i make the Thermometer capture from temperture

    Hi guys

    I have got the temperature working which capture from the board and now i want to make thermometer capture from the temperature.

    How do i do it?

    any idea how and can you provide me a code aswel thanks
    PLEASE HELP
    from

    bhav
  • DeMan
    Top Contributor
    • Nov 2006
    • 1799

    #2
    Please post more detail. It is not clear from the post, what you are trying to acheive and where you need help.

    You are also unlikely to get full code, although we are more than happy to work you through any difficulties you might find....

    Comment

    • Bhavesh1978
      New Member
      • Mar 2007
      • 32

      #3
      Originally posted by DeMan
      Please post more detail. It is not clear from the post, what you are trying to acheive and where you need help.

      You are also unlikely to get full code, although we are more than happy to work you through any difficulties you might find....
      well basically,
      my coding is too big to send it here..

      well what i done.. is that.. i have managed to get the temperature working which capture from the can motor board. and now i want to make a thermometer capture from the temperature showing excatly % as the temperature (showing graphically .. you know like when you have thermomenter in ur mouth checking ur pressure like in hospital showing the red colour rising LOL) like that

      i dont know if i have explain it clearly

      Comment

      • DeMan
        Top Contributor
        • Nov 2006
        • 1799

        #4
        So you have a method qhich gets a temperature (since it works, we don't need to know from where) and you want a graphical bar to be displayed to show how high this temperature is. Is that roughly correct?
        Have you ever programmed GUI projects before?

        Comment

        • Bhavesh1978
          New Member
          • Mar 2007
          • 32

          #5
          Originally posted by DeMan
          So you have a method qhich gets a temperature (since it works, we don't need to know from where) and you want a graphical bar to be displayed to show how high this temperature is. Is that roughly correct?
          Have you ever programmed GUI projects before?
          hi..
          yes that right i want a graphical bar to be displayed to show how high this temperature is. e.g. if the temperature is 23% then the graphical bar should show 23%

          yes i have done.. gui project.. in c programming.

          like in my programming for the temperature buffer to capture from the board
          -------------------------------------------------------------------------------------------------------------
          unsigned char temperature_buf f[120];

          //display temp in % in temperature box
          sprintf(tempera ture_buff,"%2.2 d",data[2]);
          moveto(521,90);
          outtext(tempera ture_buff);
          //display % next to temperature buffer
          moveto(545,90);
          outtext("%");

          ---------------------------------------------------------------------------------------------------------------

          so any1 knows how i can make the graphical bar please help me
          thanks

          Comment

          • horace1
            Recognized Expert Top Contributor
            • Nov 2006
            • 1510

            #6
            I assume your PC is connected to the canbus network and you are collecting data and wish to display it graphically. What compiler/operating system are you using? Many compilers come with a graphics library which you can use to draw a bargraph or you could use something like the GNU plotutils
            http://www.gnu.org/software/plotutils/

            Comment

            • Bhavesh1978
              New Member
              • Mar 2007
              • 32

              #7
              Originally posted by horace1
              I assume your PC is connected to the canbus network and you are collecting data and wish to display it graphically. What compiler/operating system are you using? Many compilers come with a graphics library which you can use to draw a bargraph or you could use something like the GNU plotutils
              http://www.gnu.org/software/plotutils/
              hi
              yes you right im using the pc which is connected to canbus board network and collecting data from the board to my c progreamming. and now i want to collect the temperature number into bar graphs
              i have managed to make a box just need to capture temp into bar graphic

              any idea how i can do it..

              Comment

              • Bhavesh1978
                New Member
                • Mar 2007
                • 32

                #8
                any1 can help me please
                thanks

                Comment

                • horace1
                  Recognized Expert Top Contributor
                  • Nov 2006
                  • 1510

                  #9
                  Originally posted by Bhavesh1978
                  any1 can help me please
                  thanks
                  what compiler are you using

                  Comment

                  • Bhavesh1978
                    New Member
                    • Mar 2007
                    • 32

                    #10
                    Originally posted by horace1
                    what compiler are you using
                    well im using old program turbo c version 2

                    Comment

                    • DeMan
                      Top Contributor
                      • Nov 2006
                      • 1799

                      #11
                      You have made a box (which I assume represents 100%), so you could add a box (filled in a different colour), with one dimension scaled down to 23% (or x%), as one solution. I'm pretty sure that because GUI programming tends to be event driven, updating this picture on a regular basis is no big deal.

                      Comment

                      • horace1
                        Recognized Expert Top Contributor
                        • Nov 2006
                        • 1510

                        #12
                        Originally posted by Bhavesh1978
                        well im using old program turbo c version 2
                        turbo c V2.0 has the graphics library <graphics.h> whih contains functions to draw rectangles and fill areas- see the help system.

                        try this program which draws a rectange and fills it
                        Code:
                         #include <graphics.h>
                         #include <stdlib.h>
                         #include <stdio.h>
                         #include <conio.h>
                        
                         int main(void)
                         {
                            /* request auto detection */
                            int gdriver = DETECT, gmode, errorcode;
                            int maxx, maxy;
                        
                            /* initialize graphics, local variables
                        */
                            initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
                        
                            /* read result of initialization */
                            errorcode = graphresult();
                            if (errorcode != grOk)
                            /* an error occurred */
                            {
                               printf("Graphics error: %s\n", grapherrormsg(errorcode));
                               printf("Press any key to halt:");
                               getch();
                               exit(1);
                               /* terminate with an error code */
                            }
                        
                            maxx = getmaxx();
                            maxy = getmaxy();
                        
                            /* select drawing color */
                            setcolor(getmaxcolor());
                        
                            /* select fill color */
                            setfillstyle(SOLID_FILL, getmaxcolor());
                        
                            /* draw a border around the screen */
                            rectangle(20, 20, 100, 100);
                        
                        
                            /* fill in bounded region */
                            floodfill(50, 50, getmaxcolor());
                        
                            /* clean up */
                            getch();
                            closegraph();
                            return 0;
                         }

                        Comment

                        • Bhavesh1978
                          New Member
                          • Mar 2007
                          • 32

                          #13
                          Originally posted by horace1
                          turbo c V2.0 has the graphics library <graphics.h> whih contains functions to draw rectangles and fill areas- see the help system.

                          try this program which draws a rectange and fills it
                          Code:
                           #include <graphics.h>
                           #include <stdlib.h>
                           #include <stdio.h>
                           #include <conio.h>
                          
                           int main(void)
                           {
                              /* request auto detection */
                              int gdriver = DETECT, gmode, errorcode;
                              int maxx, maxy;
                          
                              /* initialize graphics, local variables
                          */
                              initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
                          
                              /* read result of initialization */
                              errorcode = graphresult();
                              if (errorcode != grOk)
                              /* an error occurred */
                              {
                                 printf("Graphics error: %s\n", grapherrormsg(errorcode));
                                 printf("Press any key to halt:");
                                 getch();
                                 exit(1);
                                 /* terminate with an error code */
                              }
                          
                              maxx = getmaxx();
                              maxy = getmaxy();
                          
                              /* select drawing color */
                              setcolor(getmaxcolor());
                          
                              /* select fill color */
                              setfillstyle(SOLID_FILL, getmaxcolor());
                          
                              /* draw a border around the screen */
                              rectangle(20, 20, 100, 100);
                          
                          
                              /* fill in bounded region */
                              floodfill(50, 50, getmaxcolor());
                          
                              /* clean up */
                              getch();
                              closegraph();
                              return 0;
                           }
                          hey mate.. thanks for the codes.. but how do i capture the temperature buffer to get the themometer graphics up and down e.g. if the temp is 24 then the themometer shud b 24 how can i do that

                          Comment

                          Working...