473,503 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do i make the Thermometer capture from temperture

32 New Member
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
Mar 19 '07 #1
12 2648
DeMan
1,806 Top Contributor
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....
Mar 19 '07 #2
Bhavesh1978
32 New Member
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
Mar 19 '07 #3
DeMan
1,806 Top Contributor
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?
Mar 19 '07 #4
Bhavesh1978
32 New Member
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_buff[120];

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

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

so any1 knows how i can make the graphical bar please help me
thanks
Mar 20 '07 #5
horace1
1,510 Recognized Expert Top Contributor
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/
Mar 20 '07 #6
Bhavesh1978
32 New Member
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..
Mar 20 '07 #7
Bhavesh1978
32 New Member
any1 can help me please
thanks
Mar 20 '07 #8
horace1
1,510 Recognized Expert Top Contributor
any1 can help me please
thanks
what compiler are you using
Mar 20 '07 #9
Bhavesh1978
32 New Member
what compiler are you using
well im using old program turbo c version 2
Mar 20 '07 #10
DeMan
1,806 Top Contributor
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.
Mar 20 '07 #11
horace1
1,510 Recognized Expert Top Contributor
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
Expand|Select|Wrap|Line Numbers
  1.  #include <graphics.h>
  2.  #include <stdlib.h>
  3.  #include <stdio.h>
  4.  #include <conio.h>
  5.  
  6.  int main(void)
  7.  {
  8.     /* request auto detection */
  9.     int gdriver = DETECT, gmode, errorcode;
  10.     int maxx, maxy;
  11.  
  12.     /* initialize graphics, local variables
  13. */
  14.     initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
  15.  
  16.     /* read result of initialization */
  17.     errorcode = graphresult();
  18.     if (errorcode != grOk)
  19.     /* an error occurred */
  20.     {
  21.        printf("Graphics error: %s\n", grapherrormsg(errorcode));
  22.        printf("Press any key to halt:");
  23.        getch();
  24.        exit(1);
  25.        /* terminate with an error code */
  26.     }
  27.  
  28.     maxx = getmaxx();
  29.     maxy = getmaxy();
  30.  
  31.     /* select drawing color */
  32.     setcolor(getmaxcolor());
  33.  
  34.     /* select fill color */
  35.     setfillstyle(SOLID_FILL, getmaxcolor());
  36.  
  37.     /* draw a border around the screen */
  38.     rectangle(20, 20, 100, 100);
  39.  
  40.  
  41.     /* fill in bounded region */
  42.     floodfill(50, 50, getmaxcolor());
  43.  
  44.     /* clean up */
  45.     getch();
  46.     closegraph();
  47.     return 0;
  48.  }
Mar 21 '07 #12
Bhavesh1978
32 New Member
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
Expand|Select|Wrap|Line Numbers
  1.  #include <graphics.h>
  2.  #include <stdlib.h>
  3.  #include <stdio.h>
  4.  #include <conio.h>
  5.  
  6.  int main(void)
  7.  {
  8.     /* request auto detection */
  9.     int gdriver = DETECT, gmode, errorcode;
  10.     int maxx, maxy;
  11.  
  12.     /* initialize graphics, local variables
  13. */
  14.     initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
  15.  
  16.     /* read result of initialization */
  17.     errorcode = graphresult();
  18.     if (errorcode != grOk)
  19.     /* an error occurred */
  20.     {
  21.        printf("Graphics error: %s\n", grapherrormsg(errorcode));
  22.        printf("Press any key to halt:");
  23.        getch();
  24.        exit(1);
  25.        /* terminate with an error code */
  26.     }
  27.  
  28.     maxx = getmaxx();
  29.     maxy = getmaxy();
  30.  
  31.     /* select drawing color */
  32.     setcolor(getmaxcolor());
  33.  
  34.     /* select fill color */
  35.     setfillstyle(SOLID_FILL, getmaxcolor());
  36.  
  37.     /* draw a border around the screen */
  38.     rectangle(20, 20, 100, 100);
  39.  
  40.  
  41.     /* fill in bounded region */
  42.     floodfill(50, 50, getmaxcolor());
  43.  
  44.     /* clean up */
  45.     getch();
  46.     closegraph();
  47.     return 0;
  48.  }
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
Mar 21 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5264
by: Alex Stevens | last post by:
Hi All, On my site we are about to run a fundraising scheme. I would like to display on there a thermometer to show how far we have got to reach our total........ Does anybody know of a free...
0
1480
by: Mark Barinstein | last post by:
Hello. W2K, db2 v7, FP10a. Before now our replication worked properly. But some days ago capture suddenly stopped loggin and filling cd tables without any messages. The last message was like...
2
5122
by: Joe A | last post by:
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back end app. I have a simple form that draws a thermometer to indicate progress of code that is running. The thermometer form...
2
5961
by: Jose | last post by:
There's something for me to learn with this example, i'm sure :) Given this text: "....." and my first attempt at capture the groups: "(?:\)" RegExTest gives me what i expect: 6 captured...
1
2761
by: VM | last post by:
I'm working on a web form that displays the temperature of a certain room and I'd like to display the temperature as a thermometer where I send it the value (eg. 78 degrees F) and the thermometer...
0
1006
by: Inafuddle | last post by:
I have the same question as Alex Stevens: We are also about to run a fundraising scheme. I would like to display on there a thermometer to show how far we have got to reach our total........ ...
0
3466
by: j101 | last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but there seems to be a general problem loading a specify MQ shared library "/opt/mqm/lib/libmqm_r.so". I have MQ v6...
2
7313
by: pampululu | last post by:
hello, I try to use directx.capture in my web application, I use visual studio web developper 2005 express with c# for code behind. I can list the webcam available on computer, no probem, my...
1
3351
by: sangith | last post by:
Hi, I tried the packet capture module program. I did a file transfer using ftp from this host to another server. But when I ran the program, it was just hanging off and it did not print the...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.