In my earlier articles, I’ve written about how an NES controller works and designed some hardware for the RC2014 to talk to one.
Since then, my PCBs have arrived, and I’ve built the RC2014 module. I had to cut the track from RESET I was using to enable one of the chips and wire that to GND. I explained why in my previous post.

I’ve given the module IO address 1 using the jumper switches. This means I can talk to it using the MS-Basic commands OUT 1,X for output, and INP(1) for input.

As the output from the NES controller is active low, the green LED attached to the Data input is lit unless a button is being pressed. I should probably have wired this so it only lights if a button is being pressed. This is just a cosmetic issue.
First BASIC program
The first thing I need to do to talk to the NES controller is to toggle the Latch line. This is D1. I need to make this go from low to high, then back to low.
Next, I need to iterate the following 8 times, 1 for each bit. Read the input and toggle the Clock line high to low to get the next bit ready. If I see a zero value on my input, I know a button has been pressed.
Finally, I restart the program from the beginning.
10 REM Bit Banging an NES Controller from an RC2014.
11 REM Robert Price - October 2025.
20 REM First we toggle the Latch line on D1.
30 OUT 1,0
40 OUT 1,2
50 OUT 1,0
60 REM Iterate 8 times to get all 8 bits.
70 FOR I=0 TO 7
80 REM Get the current bit in D0.
90 LET A= INP(1)
100 REM Toggle the Clock line in D0.
110 OUT 1,1
120 OUT 1,0
130 REM If we have a non zero value, then a button has been pressed.
140 IF A=0 THEN PRINT I
150 NEXT I
160 REM loop back to the beginning.
170 GOTO 10
When I run this code and press a button, the value of I is printed on the terminal.
Improving the BASIC program
Instead of just printing a numeric value, I can print the name of the button being pressed. In my earlier article, I listed what these values were. To do this, I look at the value of variable I, and print what that value actually means.
10 REM Bit Banging an NES Controller from an RC2014.
11 REM Robert Price - October 2025.
20 REM First we toggle the Latch line on D1.
30 OUT 1,0
40 OUT 1,2
50 OUT 1,0
60 REM Iterate 8 times to get all 8 bits.
70 FOR I=0 TO 7
80 REM Get the current bit in D0.
90 LET A= INP(1)
100 REM Toggle the Clock line in D0.
110 OUT 1,1
120 OUT 1,0
130 REM If we have a non zero value, then a button has been pressed.
140 IF A<>0 THEN GOTO 230
150 IF I=0 THEN PRINT "A"
160 IF I=1 THEN PRINT "B"
170 IF I=2 THEN PRINT "SELECT"
180 IF I=3 THEN PRINT "START"
190 IF I=4 THEN PRINT "UP"
200 IF I=5 THEN PRINT "DOWN"
210 IF I=6 THEN PRINT "LEFT"
220 IF I=7 THEN PRINT "RIGHT"
230 NEXT I
240 REM loop back to the beginning.
250 GOTO 10
Running this and pressing a button now prints the name of that button to the terminal.