There isn't really an answer to that. It depends how fast you need to upfdate states and how far signals have to travel. In general the further you need to go the slower and the more discrete devices the longer it takes to update them all. You can connect a hundred LEDs to a single GPIO pin if the distance between each LED is short. See "neopixels", WS2812 etc.
The RPi is great for programming. It's great for getting some logic signals in and out. It is not great at interfacing to real-world hardware, and was never designed to be. That's why we have HATs. HATs provide the signal conditioning needed to protect the delicate RPi from the chunky outside world, and extend the functions of the RPi to analogue I/O, multiplexed switching, serial control, etc etc etc.
The first thing you need to know is how much current and how much voltage. You have to understand that the RPi GPIO outputs can only output 16mA maximum (8mA preferably), and at those currents the voltage available will be significantly less than 3V. If you want more voltage and/or current than that it is essential to use external electronics, and you need to know what your requirements are before you can choose what external electronics to use.
HATs (Hardware Attached on Top) are the extension boards designed for use with RPi. It's the easy way to go. Note some RPi extension boards can't be called HAT (because they lack certain features), but are still fine to use.
If you are trying to use the RPi simply to provide a PC with I/O, you are going the wrong way. Use the RPi if you want processing independent of the PC. What you really need is a USB relay board you can control from the PC like this: USB relay board on eBay (click). In the past, I have used a PC's Centronics printer port (old school) for I/O (up to Win98). USB to Centronics adapters are available which would allow the same thing (but need some more electronics to run motors/relays/solenoids/electromagnets/lamps...).
abojiuc wrote: ↑Mon Jul 16, 2018 10:35 pmBasically I want to be able to control about 16 or more electromagnets. To be able to turn them off and on from my PC. Each one is fairly small (dice sized) and doesn't require much current, although I will use an external power supply.
Each electromagnet will keep a plate elevated or lowered depending if it's on or off.
Your PC could control a gpio device itself, or you could use the Pi to do the calculations and control, or you could use some other device such as Arduino to do some or all of the task.
Users browsing this forum: Bing [Bot] and 46 guests