How to set GPIO as a input and output
How to set GPIO as a input and output
How to program Arduino to listen for GPIO *input* from raspberry pi's GPIO *output*
Current setup:
-
Raspberry Pi (RPi) running Raspbian
-
Arduino with a button connected to pin 12 and an LED attached to pin 8
I have the Arduino set up to listen for a "HIGH" value from pin 12 (currently a button is connected). When pressed, an LED connected to pin 8 turns on.
What I would like to achieve:
I would like to replace the button that is attached to Arduino pin 12 with a signal sent from the RPi's GPIO.
I imagine it being like this, but knowing almost nothing about electronics I need some advice about getting it to work:
-
RPi pin starts off LOW, consequently so does the Arduino's pin 12.
-
Set RPi GPIO pin to HIGH -> Arduino pin 12 records HIGH and triggers LED.
I have considered using a serial connection between the devices, but my setup assumes that the devices are on the other side of the room from each other (30 ft apart) and I only want a single wire connecting them together.
Is what I want to achieve even possible? Any help or advice would be greatly appreciated.
UPDATE: Thanks all your your replies, I have learnt a lot! I will be considering my options, especially the idea of a level shifter or RF transmitters, which are both very reasonably priced and easily available here in South Africa.