Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-11

Odd CRT

10 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Davidson

OS X 10.3.6

This code makes a window area in center of screen, and prints in that area. The new window is filled with characters when DELLINE is used. Any hints?

program TestCRT;
    uses
      CRT;
    var
       f : text;
	procedure win( s : string );
	begin
         Window( 1, 3, ScreenWidth, ScreenHeight - 2 );
		GotoXY( 1, 1 );
//		DelLine;
		Window( 1, 1, ScreenWidth, ScreenHeight );
		readln;
         GotoXY( 1, ScreenHeight - 2 );
         Write( f, s );
	end;
begin
	// Set up basic screen
	AssignCRT( f );
	Rewrite( f );
	// Make screen BLUE
	GotoXY( 1, 1 );
	TextBackground( Blue );
	ClrScr;
	// Middle window
	Window( 1, 3, ScreenWidth, ScreenHeight - 2 );
	GotoXY( 1, 1 );
	TextBackground( Cyan );
	ClrScr;
	// First message
	ClrScr;
	GotoXY( 1,ScreenHeight );
	TextColor( Blue );
	Window( 1, 1, ScreenWidth, ScreenHeight );
	GotoXY( 1, ScreenHeight - 2 );
	Write( f, 'Morning' );
     // Send some lines
	Win( 'Hello' );
	Win( 'This is a test ' );
	// Wait for human
	readln;
end.

P Davidson
Corax Networks Inc.
http://CoraxNetworks.com

Reply by email

Lance Boyle
to Paul Davidson

Does FPC provide access to USB or RS-232 (COM) ports?

I am interested in trying this on Mac OS X, with a possible port to Windows. (Yes, I'll get a USB-Serial adapter from Keyspan if necessary.) I want to keep this as simple as possible, so high-level RS-232 access without going into Apple's IOKit might be helpful. (IOKit = application-space driver capability, FYI.)

I just need to access a peripheral using simple a simple command set and read data frames back at 60 frames per second (each frame is only a few numbers, ASCII or binary, my choice), then use the received data to do some stuff.

Thanks for any info,
Jerry

Reply by email

Jonas Maebe
to Lance Boyle
Lance Boyle wrote 5 lines
Does FPC provide access to USB or RS-232 (COM) ports? I am interested in trying this on Mac OS X, with a possible port to Windows. (Yes, I'll get a USB-Serial adapter from Keyspan if necessary.)

Plain RS-232 should be fairly simple under Mac OS X once you get such an adapter. They include a driver that creates a device under /dev, which can be used as a regular serial port after you open it from your application (so if you search for generic unix serial port controlling code, it should Just Work).

USB will be a lot harder, I think, though I have no experience with that. Your code for Windows will also be quite different (whichever route you take), I assume.

Jonas

Reply by email

Adriaan van Os
to Jonas Maebe
Jonas Maebe wrote 13 lines
Lance Boyle wrote: > Does FPC provide access to USB or RS-232 (COM) ports? > > I am interested in trying this on Mac OS X, with a possible port to > Windows. (Yes, I'll get a USB-Serial adapter from Keyspan if > necessary.) Plain RS-232 should be fairly simple under Mac OS X once you get such an adapter. They include a driver that creates a device under /dev, which can be used as a regular serial port after you open it from your application (so if you search for generic unix serial port controlling code, it should Just Work).

Maybe
<http://developer.apple.com/documentation/DeviceDrivers/Conceptual/ WorkingWSerial/WWSerial_SerialDevs/chapter_1_section_1.html> is useful (converted from C to Pascal).

Regards,

Adriaan van Os

Reply by email

chromdildo
to Johann Glaser

Hi,

I am very interested in the libusb header translation, too. Do you have a public server where to put the files?

I like to write a configuration utility for the Eumex 504PC SE/USB (ISDN / PBX) in fpc/linux.

I try to implement the commands found at
http://amor.rz.hu-berlin.de/~h0444er1/eutrace/
in a lightweight gtk+ interface, without the LAN / WAN features, just configuration.

Hopefully, the header files to libusb will help me a lot... and released to the public if it is successful.

best regards.
./chrom

Johann Glaser wrote 18 lines
Hi! >OK--that's helpful, guys. I'm still scratching my head on how to tackle >this project. Thanks. > > Did you hear of libusb http://libusb.sourceforge.net/? I used it for several projects, some of which use FPC too. If you want to have my header translation to an FPC unit just drop me an email. Bye Hansi

Reply by email

Unknown author
to Johann Glaser: Hi! Did you hear of libusb http://libusb.sourceforge.net/? I used it for several…
Johann Glaser wrote 8 lines
Hi! > OK--that's helpful, guys. I'm still scratching my head on how to tackle > this project. Thanks. Did you hear of libusb http://libusb.sourceforge.net/? I used it for several projects, some of which use FPC too. If you want to have my header translation to an FPC unit just drop me an email.

It would be nice to have an entry in the contributed units page ?

Michael.

Reply by email

Johann Glaser
to Unknown author

Hi!

Show quoted text 5 lines
> Did you hear of libusb http://libusb.sourceforge.net/? I used it for > several projects, some of which use FPC too. If you want to have my > header translation to an FPC unit just drop me an email. It would be nice to have an entry in the contributed units page ?

Silly me, didn't think of that before. The unit is now contributed.

BTW: At the Miscellaneous group of units there is a contribution called "fpcusb". Its link is currently dead. Probably this entry should be removed or the author contacted.

BTW²: When I clicked the "Submit" button I first got an error message that the "/contrib/add.php3" script is not present at the server. After going back with my browsers "Back" button and again clicking the "Submit" button it worked. I tried now to look at the contribution form and again got the error message that add.php3 is missing.

Bye
Hansi

Johann Glaser Vienna University of Technology Electrical Engineering ____ http://www.johann-glaser.at/ ____

Reply by email

Unknown author
to Johann Glaser
Johann Glaser wrote 13 lines
Hi! > > Did you hear of libusb http://libusb.sourceforge.net/? I used it for > > several projects, some of which use FPC too. If you want to have my > > header translation to an FPC unit just drop me an email. > > It would be nice to have an entry in the contributed units page ? Silly me, didn't think of that before. The unit is now contributed. BTW: At the Miscellaneous group of units there is a contribution called "fpcusb". Its link is currently dead. Probably this entry should be removed or the author contacted.

I will do so.

Show quoted text 6 lines
BTW�: When I clicked the "Submit" button I first got an error message that the "/contrib/add.php3" script is not present at the server. After going back with my browsers "Back" button and again clicking the "Submit" button it worked. I tried now to look at the contribution form and again got the error message that add.php3 is missing.

This was my mistake. I fixed it.

Michael.

Reply by email