Look for in our Blog. You will find multiple applications, solutions, code examples. Navigate using the tag cloud or search using specific criteria

How to use the mapping pins of Industrial Shields Boards

In this post it is showed how to use the mapping pins of Industrial Shields boards. Before using these pins it is necessary to download the Industrial Shields boards. Follow the next link to download the boards

These boards provide you Industrial Shields PLC mapping. How it works?

For example with this boards it is not necessary to figure out what Arduino pin belong to the Industrial Shields PLC. Just using directly this PLC pin, Arduino IDE will arrange the mapping for you. To reference to the Industrial Shields Pins it must be typed like this:

Digital Outputs: QX_X

Analog Outputs: AX_X

Relay Output: RX_X

Inputs (regardless if it’s analog or digital): IX_X  

Next it is showed a sketch example:

// In this case is selected the M-DUINO 58 board
void setup() {
  // Configure INPUT pins
  pinMode(I0_0, INPUT);
  pinMode(I0_1, INPUT);
  pinMode(I1_0, INPUT);
  pinMode(I1_1, INPUT);
  pinMode(I2_0, INPUT);
  pinMode(I2_1, INPUT);

  // Configure DIGITAL OUTPUT pins
  pinMode(Q0_0, OUTPUT);
  pinMode(Q0_1, OUTPUT);
  pinMode(A0_5, OUTPUT);
  pinMode(Q1_0, OUTPUT);
  pinMode(Q1_1, OUTPUT);
  pinMode(A1_5, OUTPUT);
  pinMode(Q2_0, OUTPUT);
  pinMode(Q2_1, OUTPUT);
  pinMode(A2_5, OUTPUT);

void loop() {
  // Toggle pins once a second
  digitalWrite(Q0_0, HIGH);
  digitalWrite(Q0_1, HIGH);
  digitalWrite(Q1_0, HIGH);
  digitalWrite(Q1_1, HIGH);
  digitalWrite(Q2_0, HIGH);
  digitalWrite(Q2_1, HIGH);

  digitalWrite(Q0_0, LOW);
  digitalWrite(Q0_1, LOW);
  digitalWrite(Q1_0, LOW);
  digitalWrite(Q1_1, LOW);
  digitalWrite(Q2_0, LOW);
  digitalWrite(Q2_1, LOW);


See also: