@chrishuck Knitting machines even predate sewing machines - the first knitting frames go back to the late 1500s. There's a museum in England that I hope to one day visit.
The flatbed machines I have work similarly to the circular ones, except the carriage goes back and forth rather than around.
So here's a punchcard reader :) The 24 silver pins fall into the punchcard holes (or not); the white drum pushes on the ones that are selected, which moves the black rods, which are connected to the hooked metal strips at the bottom of the image. Each metal strip selects, iirc, every eighth needle. Selected needles take a different path through the carriage as it passes over them with the yarn, which causes different things to happen depending on which combination of buttons the knitter has chosen.
(This particular machine still isn't selecting needles properly, so we're going to have to open it back up and try to figure out why...)