Scratch4A, EL wires and pin remapping

Hello,
I have an arduino uno coupled with the el escudo dos shield to power two el wires.
The el wires pins are located on pins 2 - 9 but Scratch4A lets me handle only digital pins 13,12,11,10.
I tried messing with the provided firmware, doing something crude like:

pinstatus=digitalRead(pin13)
digitalWrite(pin2,pinstatus)

to “remap” the pins but it doesnt work (el wire randomly is on and off and it doesnt seem to respond to the scratch4 a commands.

The setup is this :

And the details are explained in the shield’s page :here

TL;DR :

Programming the EL Escudo Dos is very easy. No libraries are needed; controlling the output channels is as simple as turning a LED on or off. In fact, that’s exactly what you’re doing - inside each of the eight optotriacs on the board is an LED that is internally coupled to a light sensor on the high-voltage side. By using light to bridge the gap between the AC and DC sides of the circuit, there is complete electrical isolation, which makes the board safe and reliable.

The eight EL channels, labeled “A” through “H” on the board, are linked to digital I/O pins 2 through 9

Scratch4A can be found here. Some details on how pins are arranged :

Components have to be connected in a particular way. S4A allows for 6 analog inputs (analog pins), 2 digital inputs (digital pins 2 and 3), 3 analog outputs (digital pins 5, 6 and 9), 3 digital outputs (pins 10, 11 and 13) and 4 special outputs to connect Parallax continuous rotation servomotors (digital pins 4, 7, 8 and 12).

And the Scratch4A firmware which I am trying to play with is here

(Thanks a lot for comments and suggestions, I hope this is enough)

So

Is it feasible to do this?

The exact code in the function I am using is this :

arduinoPins[0].type=input;
 arduinoPins[1].type=input;
 arduinoPins[2].type=digital;
 arduinoPins[3].type=input;
 arduinoPins[4].type=servomotor;
 arduinoPins[5].type=pwm;
 arduinoPins[6].type=pwm;
 arduinoPins[7].type=servomotor;
 arduinoPins[8].type=servomotor;
 arduinoPins[9].type=digital;
 arduinoPins[10].type=digital;
 arduinoPins[11].type=digital;
 arduinoPins[12].type=input;
 arduinoPins[13].type=input;
}

void resetPins() {
 int readport12=0;
 int readport13=0;
 int readport2=1;
 int readport9=1;
 
 for (byte index=0; index <=13; index++) 
 {
   if (arduinoPins[index].type!=input)
   {
     pinMode(index, OUTPUT);
     
     if (arduinoPins[index].type==servomotor)
     {
       arduinoPins[index].state = 255;
       servo (index, 255);
     }
     else
     {
       arduinoPins[index].state=0;
       digitalWrite(index,LOW);
     }
   }
 }

//remap pins
readport12=digitalRead(12);
Serial.print("Status of port 12 is:");Serial.println(readport12);
digitalWrite(2,readport12);
Serial.print("Statues of port 2 is:");Serial.println(digitalRead(2));
readport13=digitalRead(13);
digitalWrite(9,readport13);


}

Does the sketch work with the shield removed?

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your entire code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Also can you ost links to your shield and scratch4A ? ? ?

Thanks.. Tom... :slight_smile:

OK post is formatted and updated according to instructions :smiley:

Hi,
Please do not update posts with later requested information.
Please put it in a new post.
The reason is that someone in the future may have a similar inquiry and by updating previous post you confuse the flow of the thread.

we need to see your complete code as your segment is only meaningful to you.

Thanks.. Tom... :slight_smile: