Took a little trial-n-error, but I was able to create a simple program to turn the new relay on/off that is part of OSPi 1.3.
Wanted to share, but also wanted to ensure this is the right snippet to control it within a C program. Sometimes ‘works’ is not always ‘right’…
Looks correct to me. Now, there are some differences between wiringPi’s pin numbers vs. the BCM GPIO numbers: https://projects.drogon.net/raspberry-pi/wiringpi/pins/
on OSPi 1.3, the rain sensor is connected to the TXD pin (the 4th pin on the right column of P1), and relay is RXD pin (the 5th pin), depending on whether you are referencing wiringPi’s pin number or BCM GPIO numbers, it could be either 15 or 16.
Thanks Ray for the link on the wiring diagram and confirming my code. I wasn’t sure which was the preferred function to initialize since wiringPi had three (wiringPiSetup, wiringPiSetupGpio, wiringPiSetupSys) but the first one I tried worked so I ran with it. Also, it was easy to solder a couple jumper wires to the board to use the relay’s output. That was clearly marked on the board. Nice touch having the +5V power and ground breakouts on the board conveniently located an inch away too. Just waiting for the snow to melt now!