Go to Post Iteration is something everyone can do. - [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2004, 17:42
Venkatesh Venkatesh is offline
Registered User
FRC #0030
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 260
Venkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to behold
QBASIC Dashboard Program

Hello Everybody,

I have started working on a dashboard program in QBASIC for this year's OI. I chose QBASIC because it is simple enough, and I know how to do some things in it.

I have already been able to open the serial port, detect which frame in incoming, and store the input stream in a 26-byte arrary. However, I am having a strange problem when attempting to display the values. If I use print to output the parts of the array, I get the ascii character representing the byte in the element of the array. This is a problem, as letters and ascii symbols are not easily parsed by humans. Is there a way that I can output data from the print command, out of a character variable, in a decimal format?

Also, for those teams working on a dashboard program, do not repeatedly set and unset the DTR pin. The OI tends to act flakey until it is reset if you do so.
__________________
-- vs, me@acm.jhu.edu
Mentor, Team 1719, 2007
Team 30, 2002-2005
  #2   Spotlight this post!  
Unread 31-01-2004, 18:38
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: QBASIC Dashboard Program

It's been SEVERAL years since I've touched QBASIC, but I'm about 90% sure you're looking for the ASC$ function.

PRINT ASC$(A)
  #3   Spotlight this post!  
Unread 02-02-2004, 07:28
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: QBASIC Dashboard Program

Can you download programs to the '04 OI? How?
  #4   Spotlight this post!  
Unread 02-02-2004, 08:51
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: QBASIC Dashboard Program

Quote:
Originally Posted by Astronouth7303
Can you download programs to the '04 OI? How?
No, the OI is not programmable.
  #5   Spotlight this post!  
Unread 02-02-2004, 09:36
Jeff_Rice's Avatar
Jeff_Rice Jeff_Rice is offline
ElementisRegamusProelium
#1359
Team Role: Programmer
 
Join Date: Dec 2002
Location: Linn County
Posts: 283
Jeff_Rice will become famous soon enoughJeff_Rice will become famous soon enough
Re: QBASIC Dashboard Program

The idea with a dashboard program is that it is run on a computer that is hooked up to the dashboard port on the OI. The OI reports this information through the db port, and then the program picks up the bytes and displays them in some meaningful fashion.

Anyway, congratulations on your achievement! I didn't know it was possible to access the serial port in QBASIC. Good job!
__________________
"He said my name is Private Andrew Malone
If you're reading this then I didn't make it home
But for every dream that's shattered another one comes true
This car was once a dream of mine now it belongs to you
And though you may take her and make her your own
You'll always be riding with Private Malone" David Ball, "Private Malone"
  #6   Spotlight this post!  
Unread 02-02-2004, 20:07
Venkatesh Venkatesh is offline
Registered User
FRC #0030
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 260
Venkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to behold
Re: QBASIC Dashboard Program

Thanks Jeff,

Also, thanks KevinB. The ASC$ function was able to help me display the data correctly. I had never used that function before.

As soon as I make some good, usable dashboard code in Qbasic, I will post it. I am having a number of problems, such as the program crashing Windows 9x machines if it is run when the OI is off. Also, occationally the computer is unable to synchronize with the input frame of 26 bytes (especially if at least one byte is a 255) and displays garbage for a few frames.

Now I have a question for programmers out there. Qbasic is not particularly suited to visualization. I was only planning on using it to read the data from the serial port and feed it into something fancier. No Screenmode 13 graphics here =).

I was planning on having Qbasic output data into textfiles, stored on a Ramdisk. Then, I was thinking of using a few perl scripts and a webserver, to have the data available in a web browser. Can any of you tell me about any different (better) schemes for showing off data?
__________________
-- vs, me@acm.jhu.edu
Mentor, Team 1719, 2007
Team 30, 2002-2005
  #7   Spotlight this post!  
Unread 02-02-2004, 20:58
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: QBASIC Dashboard Program

Quote:
Originally Posted by Venkatesh
Can any of you tell me about any different (better) schemes for showing off data?
In the off-season, a friend of mine and I came up with a system where we wrote all the data to 40 or so different text files in order, then overwrote the first one again every second or so, and so on. Then we used Macromedia Flash (much more suited to visualization) to read the files and display the data.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #8   Spotlight this post!  
Unread 02-02-2004, 21:31
Greg's Avatar
Greg Greg is offline
Registered User
FRC #1075 (Sinclair Sprockets)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2003
Location: Whitby, Ontario, Canada
Posts: 108
Greg is on a distinguished road
Send a message via ICQ to Greg Send a message via MSN to Greg
Re: QBASIC Dashboard Program

Quote:
Originally Posted by Pat Fairbank
In the off-season, a friend of mine and I came up with a system where we wrote all the data to 40 or so different text files in order, then overwrote the first one again every second or so, and so on. Then we used Macromedia Flash (much more suited to visualization) to read the files and display the data.
You can do it a lot easier than this Just put a Macromedia Flash ActiveX control on the form in VB (or Delphi, or any other environment that supports ActiveX). You can then set variables in the Flash movie directly. The Flash movie can interact with your program using the fscommand() function.
  #9   Spotlight this post!  
Unread 02-02-2004, 21:40
velocipenguin velocipenguin is offline
Registered User
#0246 (Overclocked)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Boston, MA
Posts: 77
velocipenguin is on a distinguished road
Send a message via AIM to velocipenguin
Re: QBASIC Dashboard Program

Quote:
Originally Posted by Venkatesh
Can any of you tell me about any different (better) schemes for showing off data?
If you can handle C or C++, you could write a frontend that uses OpenGL or some other graphics library to display the collected data in real time.
  #10   Spotlight this post!  
Unread 02-02-2004, 21:43
Guest
 
Posts: n/a
Re: QBASIC Dashboard Program

In C/C++ combine OpenFile with ReadComm/WriteComm.

In VB, use the MSComm control.

Exact code can be found at Microsoft's MSDN:

http://msdn.microsoft.com/
  #11   Spotlight this post!  
Unread 04-02-2004, 07:34
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: QBASIC Dashboard Program

There are OpenGL (And DirectX, VB only compiles to windows) for VB.

If you can get a hold of a licensed version of the MSComm, You can put it in VBA. In word, open the Visual Basic toolbar, and press "Visual Basic Editor". It's not quite the same, but close enough. If anyone wants to know how to use the MSComm for dashboard, Ask and I'll send some sample code I got from this site.

I have a hunch that the terminal window in the IFI_Loader just outputs what it receives from the COM port (Ascii characters, no interpretation). Can any anyone deny/confirm this?
  #12   Spotlight this post!  
Unread 12-02-2004, 16:47
Camel85kv Camel85kv is offline
Registered User
#0937
 
Join Date: Feb 2004
Location: Shawnee, KS
Posts: 2
Camel85kv is an unknown quantity at this point
Re: QBASIC Dashboard Program

I wrote a Qbasic Dashboard program and it works well enough to share.

It

-detects packets
-saves the data into an array
-performs basic processing of the data
-displays data on screen
-cleanly handles COM port errors

Right now it is set up to read the OI, not the RC. Simply modify the "SELECT CASE 4" by changing it to "SELECT CAES packnum" in one of the subs to use the RC data instead. This is untested. There might be a bug with the PacketFrame!() Function.

If you simply load this program and run it, it may take two or three tries to connect. Just tell it to retry a few times. You should set Qbasic (or the compiled program) to run on compatibility mode for windows 98 if you are running XP. Windows XP does werid things to the COM port... To do this, right click on icon, properties, (etc).

If you use this code, please let me know and mention team 937. I don't check this board often, so email questions to kvogt {AT} everestkc.net.

-Kyle Vogt
-Team 937
Attached Files
File Type: zip TEAM937.zip (2.6 KB, 29 views)
  #13   Spotlight this post!  
Unread 12-02-2004, 17:27
Rhs953's Avatar
Rhs953 Rhs953 is offline
Revenge is near...
AKA: Mike
#0953 (Illumanati)
Team Role: Engineer
 
Join Date: Jan 2004
Location: Reno
Posts: 99
Rhs953 has a little shameless behaviour in the past
Send a message via AIM to Rhs953
Re: QBASIC Dashboard Program

Heres a link to the dashboard program.


http://www.innovationfirst.com/FIRST...board_Spec.pdf
__________________
___________________________
If all else fails, use a bigger hammer.
  #14   Spotlight this post!  
Unread 12-02-2004, 17:57
Venkatesh Venkatesh is offline
Registered User
FRC #0030
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 260
Venkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to behold
Re: QBASIC Dashboard Program

I like your code, Camel85kv. Thanks for the file.

For those of you unable to open the file, it was saved with QuickBASIC 4.5 (not QBASIC). I have QuickBASIC (purchased it years ago), but I recognize the fact that very few people do. I am posting a text version of Team 937's fine work here. The text version is compatible with QBASIC.
Attached Files
File Type: zip text team937.zip (1.7 KB, 44 views)
__________________
-- vs, me@acm.jhu.edu
Mentor, Team 1719, 2007
Team 30, 2002-2005
  #15   Spotlight this post!  
Unread 12-02-2004, 18:04
Camel85kv Camel85kv is offline
Registered User
#0937
 
Join Date: Feb 2004
Location: Shawnee, KS
Posts: 2
Camel85kv is an unknown quantity at this point
Re: QBASIC Dashboard Program

Thanks for the kind words! You are right, QuickBasic is a bit harder to find than the original QBasic. I'm glad you pointed that out because that file is jibberish to people without QuickBasic. Let me know if something does not work.

-Kyle Vogt
-Team 937
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a dashboard program Jeff_Rice Programming 18 04-05-2003 23:21
Custom dashboard program available. Interest? archiver 2001 4 24-06-2002 00:45
miroboworks dashboard program? archiver 2000 3 23-06-2002 23:04
CCISD Updated Dashboard program v2.2.1 archiver 2000 3 23-06-2002 21:57
Yet another dashboard program Neal Probert Programming 3 12-05-2002 10:43


All times are GMT -5. The time now is 00:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi