1 Replies - 2233 Views - Last Post: 23 December 2007 - 08:02 PM Rate Topic: -----

#1 craig1709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 14-June 07

Simulate LCD in terminal / command prompt

Posted 23 December 2007 - 07:23 AM

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
	 __
  |	| |  |
  |  __| |__|
  |  |	  |
  |  |__	|


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 December 2007 - 07:52 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Simulate LCD in terminal / command prompt

#2 Nayana  Icon User is offline

  • DIC Hawk - 나야나 नयन:
  • member icon

Reputation: 32
  • View blog
  • Posts: 824
  • Joined: 14-November 07

Re: Simulate LCD in terminal / command prompt

Posted 23 December 2007 - 08:02 PM

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
._
|_|
|_|



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

This post has been edited by Nayana: 23 December 2007 - 08:02 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1