Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,169 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,905 people online right now. Registration is fast and FREE... Join Now!




Simulate LCD in terminal / command prompt

 
Reply to this topicStart new topic

Simulate LCD in terminal / command prompt

craig1709
23 Dec, 2007 - 06:23 AM
Post #1

New D.I.C Head
*

Joined: 14 Jun, 2007
Posts: 18


My Contributions
This is really a general problem, although I will have to implement it in Pascal. We have to simulate a petrol pump, not too difficult, except for the LCD. If the price of the petrol is £1.24 it should display
CODE

     __
  |    | |  |
  |  __| |__|
  |  |      |
  |  |__    |

Pardon the crappy ASCII art. The trouble is, what if it's £1.34? Then I have to replace the 2 with a 3 and this has to be done in the command prompt. The only thing I've thought of is having each line for each permutation but that's a stupid number of permutations. The course teacher is useless and doesn't know / won't help.

Any better ideas..?
-Craig1709

Edit: I now know the name of what I'm trying to emulate: a seven segment LCD display.

This post has been edited by craig1709: 23 Dec, 2007 - 06:52 AM
User is offlineProfile CardPM
+Quote Post

Nayana
RE: Simulate LCD In Terminal / Command Prompt
23 Dec, 2007 - 07:02 PM
Post #2

DIC Hawk - 나야나 नयन:
Group Icon

Joined: 14 Nov, 2007
Posts: 824



Thanked: 5 times
Dream Kudos: 175
My Contributions
Well for a start, your ASCII art doesn't emulate a 7 segment display. I.e. you only have 7 segments to work with which are
CODE

._
|_|
|_|


And as for writing to a particular screen location, first use the command
GotoXY(x,y);

This post has been edited by Nayana: 23 Dec, 2007 - 07:02 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 12:28AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month