vga and ps2 mouse on the same pin?

This might be a stupid question.Can I use pin 6(I think its clock) and connect it to the vga connector and the ps2 mouse so that they are both sharing the same pin?I have an UNO and I need them both to connect to pin 6 because on the schematics for connecting the arduino to the vga and the ps2 mouse they both require the same digital pin 6.If it isn't possible for them to share pin 6, is there any way to overcome this problem?Summary of my problem-I need the vga and ps2 mouse but they both require pin 6.Here are the links for schematics for the vga(scroll down and you will see the wiring schematics):http://garagelab.com/profiles/blogs/arduino-generated-vga-color-signal-complete

and for the ps2 mouse:http://playground.arduino.cc/ComponentLib/Ps2mouse

Can I use pin 6(I think its clock) and connect it to the vga connector and the ps2 mouse so that they are both sharing the same pin?

No.

You will have to change the code of one of them to use another pin. The Ps2Mouse one looks like it might be the easiest one to change.

I have not tried this but driving a VGA requires a lot of resource from the processor so it might not be possible to have both these connected at the same time.

thanks for the reply! :slight_smile: I think I figured out how to change the pin number.Here is the mouse example code from the ps2 library.I think I just change the numbers in the first uncommented line-PS2 mouse(6, 5);I think that I just have to change 6 to another pin number?Maybe?If I change the first parameter, 6 to another pin number will it still work?Is there anything special about pin 6?Also,since you said that vga requires lots resource from the processor would overclocking help?Overclocking instructions link:http://garagelab.com/profiles/blogs/atmega328-overclock-30mhz
PS2 example code below:
#include <ps2.h>

/*

  • an arduino sketch to interface with a ps/2 mouse.
  • Also uses serial protocol to talk back to the host
  • and report what it finds.
    */

/*

  • Pin 5 is the mouse data pin, pin 6 is the clock pin
  • Feel free to use whatever pins are convenient.
    */
    PS2 mouse(6, 5);

/*

  • initialize the mouse. Reset it, and place it into remote
  • mode, so we can get the encoder data on demand.
    */
    void mouse_init()
    {
    mouse.write(0xff); // reset
    mouse.read(); // ack byte
    mouse.read(); // blank */
    mouse.read(); // blank */
    mouse.write(0xf0); // remote mode
    mouse.read(); // ack
    delayMicroseconds(100);
    }

void setup()
{
Serial.begin(9600);
mouse_init();
}

/*

  • get a reading from the mouse and report it back to the
  • host via the serial line.
    */
    void loop()
    {
    char mstat;
    char mx;
    char my;

/* get a reading from the mouse */
mouse.write(0xeb); // give me data!
mouse.read(); // ignore ack
mstat = mouse.read();
mx = mouse.read();
my = mouse.read();

/* send the data back up /
Serial.print(mstat, BIN);
Serial.print("\tX=");
Serial.print(mx, DEC);
Serial.print("\tY=");
Serial.print(my, DEC);
Serial.println();
// delay(20); /
twiddle */
}

* Pin 5 is the mouse data pin, pin 6 is the clock pin
 * Feel free to use whatever pins are convenient.

Hi, I assume the original author of the sketch wrote that comment. It answers your question pretty clearly!

Paul

Thanks.Just had to confirm. ;)