I’m sure @wizard will correct me, but I believe I read that V3 didn’t have pin access yet. One of many things v3 will get, but I suspect tracking down v3 bugs (like wireless issues) is (correctly) eating into available time to add missing rarely used bits like this back.
Pin 26 is on the top, then pin 25. There are small labels (IO26, IO25), but the fine printing is sometimes a bit too smudged to read easily.
I think you know this already, but for the benefit of others finding this page:
Keep in mind that for driving a relay a fairly large current is required, much more than a GPIO can output or sink. The inductance in the coils also tend to kick back, so feedback protection is needed. Usually this is done with a transistor or MOSFET and a diode. You can also get relay modules that have these drivers included and are intended to work with digital signals from a microcontroller.
Thanks for the reply, I tried your test pattern, and it works.
Weirdly, my test pattern doesn’t, but I swear I was doing the same thing. Here is my test pattern which doesn’t work:
var power24v = 26
export var test
pinMode(power24v,OUTPUT)
export function sliderPower(x) {
test = (x > 0.5) // Assumes pin goes high to enable 24V supply
digitalWrite(power24v, test)
}
I’m just testing with a DMM right now, but the relay I’m using is an opto-isolated relay module. It doesn’t switch the 24V directly, but is the input to a 20A relay.
But - step 1. get the GPIO ports to work…
Update, OK it was me being an idiot. I still had the render function in there (scrolled off the bottom) and at some point in my testing, I put digitalWrite(power24v, HIGH) in there - doh!