Interacting with the outside world.

Back when I owned a Commodore 64 (and a PET before that) I wrote a lot of programs that interacted with the outside world. By "interacted with the outside world" I mean the program could test whether a switch was on or off, and it could force a single pin on a port to go high or low. By switch I mean a physical toggle switch that a person turned on or off by hand, a relay, a thermostat, etc. The output pin could turn a light on or off, open or close a relay, etc. The C-64 had a "port" on the back that you could connect to simple home-brew circuit boards to accomplish this. The programs, in BASIC of course, used PEEK and POKE commands with a logical mask to read from and write to the port which was at a certain address in the machine.

I'd like to do this with a PC and Pascal but don't know how. The natural choice for a port is the Centronics parallel port but I have no idea how to read or write to it.

Another idea. Is it possible to build a board that would allow you to "PEEK" and "POKE" to a port like on the C-64?


Comments

  • : Back when I owned a Commodore 64 (and a PET before that) I wrote a
    : lot of programs that interacted with the outside world. By
    : "interacted with the outside world" I mean the program could test
    : whether a switch was on or off, and it could force a single pin on a
    : port to go high or low. By switch I mean a physical toggle switch
    : that a person turned on or off by hand, a relay, a thermostat, etc.
    : The output pin could turn a light on or off, open or close a relay,
    : etc. The C-64 had a "port" on the back that you could connect to
    : simple home-brew circuit boards to accomplish this. The programs,
    : in BASIC of course, used PEEK and POKE commands with a logical mask
    : to read from and write to the port which was at a certain address in
    : the machine.
    :
    : I'd like to do this with a PC and Pascal but don't know how. The
    : natural choice for a port is the Centronics parallel port but I have
    : no idea how to read or write to it.
    :
    : Another idea. Is it possible to build a board that would allow you
    : to "PEEK" and "POKE" to a port like on the C-64?
    :
    :
    :
    Here's a short tutorial including example code:
    http://www.doc.ic.ac.uk/~ih/doc/par/doc/data/tp.html
  • : : Back when I owned a Commodore 64 (and a PET before that) I wrote a
    : : lot of programs that interacted with the outside world. By
    : : "interacted with the outside world" I mean the program could test
    : : whether a switch was on or off, and it could force a single pin on a
    : : port to go high or low. By switch I mean a physical toggle switch
    : : that a person turned on or off by hand, a relay, a thermostat, etc.
    : : The output pin could turn a light on or off, open or close a relay,
    : : etc. The C-64 had a "port" on the back that you could connect to
    : : simple home-brew circuit boards to accomplish this. The programs,
    : : in BASIC of course, used PEEK and POKE commands with a logical mask
    : : to read from and write to the port which was at a certain address in
    : : the machine.
    : :
    : : I'd like to do this with a PC and Pascal but don't know how. The
    : : natural choice for a port is the Centronics parallel port but I have
    : : no idea how to read or write to it.
    : :
    : : Another idea. Is it possible to build a board that would allow you
    : : to "PEEK" and "POKE" to a port like on the C-64?
    : :
    : :
    : :
    : Here's a short tutorial including example code:
    : http://www.doc.ic.ac.uk/~ih/doc/par/doc/data/tp.html

    Thanx

    Actor



  • :
    : Thanx
    :
    : Actor

    I'm all excited! Maybe I'll have to go fire up my C-64...
    ...and if I start loading a game tonight then I can maybe play tomorrow.

    lol
  • : :
    : : Thanx
    : :
    : : Actor
    :
    : I'm all excited! Maybe I'll have to go fire up my C-64...
    : ...and if I start loading a game tonight then I can maybe play
    : tomorrow.
    :
    : lol
    Building a robot is more like what I had in mind. lol

    Back in the heyday of the C-64 our phone company did not have tone dialing so I built an interface and wrote a C-64 program to pulse dial a phone number that you typed into the system. It would also speed dial about 100 numbers. I also built a morse code generator that used a relay to key a radio transmitter.

    The robot I have in mind is for use in a darkroom. The program would sense the density of a 35mm negative, measure the distance from the enlarger head to the easel and calculate the correct exposure time, then turn the enlarger lamp on for precisely that amount of time.

    Another robot will sense the temperature of the developer in a tank and continuously update the correct exposure time as the temperature of the developer drifts. I figure that is cheaper than buying an expensive Jobo.

    Actor

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories