Help understanding section control

I don’t think I understand all I know about section control (Machine v5_5 AOG 5.6). yep, I’m confused!

I have 1 section set as 1 in AOG

How does this translate to the Machine.ino pin assignment? Since -

if (pin[0]) digitalWrite(13, relayState[pin[0] - 1]);

is the first on the list does this mean arduino pin 13 is my first relay pin?

At the beginning of the code there is an explanation, so section 0-5, D7-D12, so I think section 1 is D7.

/*
* This program only turns the relays for section control
* On and Off. Connect to the Relay Port in AgOpenGPS
*
* Hydraulic Raise D4
* Hydraulic Lower D3
*
* Tram Right Side D5
* Tram left Side D6
*
* Section 0 to 5 – D7 to D12
*
*/

So what is happening in the void SetRelays(void) function?

if (pin[0]) digitalWrite(13, relayState[pin[0] - 1]);

//if (pin[10]) digitalWrite(IO#Here, relayState[pin[10]-1]);

Don’t know why I couldn’t get my led to blink, got it working so I could test and understand.

So the .INO with the defaults works as presented. If you use it as default, pin 13 will be your left most relay, pin 5 would be 2nd and so on. Pin 4 would be relay 10.

So in my case with 1 section;
if (pin[0]) - I have setup 1 section so we are going to set -
digitalWrite(13, - arduino pin 13 to the value read in -
relayState[pin[0] - 1]);

This makes it pretty easy to set the relay pins to what ever you want, just change the pin # to what you want.

1 Like

There is also a new configuration page:

2 Likes

Any of the pins can be configured to be anything!

Section 1 = 0 in the nano, because thats where the nano starts counting.

But then is addressed to a pin on the nano, In the stock .ino they seem fairly random. When I get back to the laptop I will post the udp .ino I have with really good notes in it.

The cards from jlcpcb are at customs so soon will be testing easy section control hookup.

On telegram Brian has added 64 equal size sections, but it will not affect the current setup.

Looking forward to that!

https://drive.google.com/drive/folders/1eu1kRQZeTh1KxFTVx2GO8aPw4vVIs6C_?usp=share_link

Lots of //Notes on the inputs and outputs

The output configuration is meant to work with a PCB to directly connect to this preassembled relay board, in its 12 V variety as it comes with a 5V regulated supply


The boards are currently in customs, so not sure if smoke containing or releasing yet. First attempt at PCB design.

5 Likes