hold a pin down to ground how to?

im just getting my head around all this arduino programming and how the board works and i have a board that has triggers on it that can be triggered by holding a pin down to ground for 500ms. there are 10 of which i will be using 7 so i need to know on a mega board how can i trigger these pins

ie pins 40 to 47 can i hold a pin to ground by software commands

You can use the command digitalWrite(40, LOW); Take care current will be low enough for arduino to handle it.

//pinMode(40,OUTPUT); should go in setup.

digitalWrite(40,0); delay(500); digitalWrite(40,1);

mikewitney: im just getting my head around all this arduino programming and how the board works and i have a board that has triggers on it that can be triggered by holding a pin down to ground for 500ms.

That is not very clear.

I think you mean that you have another non-Arduino device that you want to control with an Arduino, and to do so the Arduino has to change a voltage from HIGH to LOW and keep it low for 500ms.

Please confirm that this is correct, or explain where it is incorrect.

You must ensure that the connection to the other device does not cause more than a few mA to flow into or out of the Arduino pin to which is is connected. The absolute max for an I/O pin is 20mA but the max for several pins together is lower. You need to read the Atmel datasheet for the MCU in your Arduino.

You must ensure that the other device NEVER puts a voltage outside the range 0v to 5v on the Arduino pins.

You also need a GND connection between the Arduino and the other device.

...R

DrAzzy:
//pinMode(40,OUTPUT); should go in setup.

digitalWrite(40,0);
delay(500);
digitalWrite(40,1);

thanks that worked a treat. im just happy i opted for the mega without it i would have run out of pins and memory by now

Robin2: That is not very clear.

I think you mean that you have another non-Arduino device that you want to control with an Arduino, and to do so the Arduino has to change a voltage from HIGH to LOW and keep it low for 500ms.

Please confirm that this is correct, or explain where it is incorrect.

You must ensure that the connection to the other device does not cause more than a few mA to flow into or out of the Arduino pin to which is is connected. The absolute max for an I/O pin is 20mA but the max for several pins together is lower. You need to read the Atmel datasheet for the MCU in your Arduino.

You must ensure that the other device NEVER puts a voltage outside the range 0v to 5v on the Arduino pins.

You also need a GND connection between the Arduino and the other device.

...R

the other device is the Adafruit soundboard. and i was having problems using TX/RX communications it was slowing the touchscreen right down to a crawl for some reason. but it also works off GPIO triggers. the board is powered by 3.5v independently but the whole system has a shared ground. so the //pinMode(40,OUTPUT); should go in setup.

digitalWrite(40,0); delay(500); digitalWrite(40,1);

works fine and i have 6 out of 11 trigger pins connected and all work fine