-
1Step 1
Get your Breadboard out.
-
2Step 2
Put buttons on Breadboard on the center.
-
3Step 3
On each Button put a resistor going to ground.
-
4Step 4
Attach Ground and Power(5V).
-
5Step 5
On the side of the Buttons that you put the resistor put a cable in.
-
6Step 6
Attach the cable to pins 2,3,4, and 5.
-
7Step 7
Put power to the other side of the buttons(where you didn't put ground)
-
8Step 8
Power on Raspberry Pi and attach the Arduino to it!
-
9Step 9
Upload this sketch to Arduino:
void setup() {
Serial.begin(9600);
pinMode(2,INPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
pinMode(5,INPUT);
}
void loop() {
Serial.println(digitalRead(2));
Serial.println(digitalRead(3)+2);
Serial.println(digitalRead(4)+4);
Serial.println(digitalRead(5)+6);
delay(300);
}
-
10Step 10Get pySerial on your Pi.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.