Just wanting to ask if there's a way that an old computer could be like a microcontroller. In the sence that it has a range of pins (standard, PWM and analogue), both input and out put could be emulated by the operating system.
If you mean a VERY old computer: the parallel port on the really old ones (IBM PC) was such an I/O port. On later ones it was a bit more complex, but could still be read and written by a simple I/O instruction.
On current PCs things are not that simple any more, and there are layers upon layers of hardware and software between the CPU and pins that go to the outside world.
If you want to play with I/O pins: get a bare micro-controller (PIC, Cortex M0, AVR), or a development board (Arduino is a popular one), or a Raspberry Pi.
I'm assuming that a computer, which the O.P. has in mind, is an old PC-like desktop or laptop.
There are ways to add microcontroller-style I/O to a computer (old or new). The class of peripherals that does this is usually called I/O cards or DAQ (data acquisition) card. The complexity and functionality of these devices varies a lot.
A good example of a simple I/O card is NI USB-6008. Another example: an Arduino can be used as a USB I/O card.
No computer that you would be able to buy today could do that. Computers with that capability didn't even have operating systems, let alone GUIs. Even if you could get your hands on one of these antiques, you need to be an assembly programmer to make them do anything.
There is hope for this idea, though. Embedded Linux boards like the BeagleBone are full-featured computers running Linux, and they have I/O pins like an Arduino. You access the pins through a VFS (Virtual FileSystem). Essentially each pin is represented by a text file, and you set it on or off by writing 0 or 1 to that file. You can write programs by using any scripting language you like, and writing scripts that write to the files. It being an actual computer, it has some things onboard, which saves time with things like audio. Some single-board computers eg Raspberry Pi have I/O pins also.
If you really want to use a normal computer, you can get I/O expansion cards. These will give this functionality to any desktop, and some models even for laptops. Some of these can be pricey, though, and some require custom software and/or a specific OS. They are not the best option, but might be worth a look.
Hope this helps!
I woud answer your question about the old computer itself with no. But you can use interfaces or for example the Raspery Pi coud be the solution you are looking for. It has the low-level peripherals:
- 8 × GPIO
- I²C bus
- SPI bus with two chip selects
- I²S audio
- +3.3 V
- +5 V
and it runs with a Linus OS.
Look here for more details.