Arduino to Pololu High-Power Motor Driver 18v15

Good day

Can someone please post a picture on how to connect the Pololu High-Power Motor Driver 18v15 to an Arduino Duemilanove. and if possible can someone please post me a scetch that I can use for the following setup, see attached picture, and if there are any proramming experts out there that can write a “simple” c# app similar to the one in the attached picture.
Thank you and regards,
Riaan Deyzel


Hello.

Have you read the Using the Motor Driver section of the product webpage?

The minimum connections you need to make are V+,GND, OUTA, and OUTB on the motor power side (the side with bigger through-holes) and PWM and DIR on the logic side (the side with smaller through-holes).

If you post an image showing how you think it should be connected, I can look at it to help you make sure it is correct. You could use this picture as a starting point:

- Ryan

Good day

Please follow this link to check out the connections to my arduino, can you check if it is correct?
http://robotcontrol.yolasite.com/build.php

Thank you & regards
Riaan Deyzel

Hi, Riaan.

I looked at your diagram. It looks correct to me.

- Ryan

Good day

Thank you for checking. My Motor Driver is waiting for me at the Post Office to collect, and I can not wait to test it.

Thank you & regards,
Riaan Deyzel

Good day

Does anyone have any C# source code for me to be able to control a motor or servo?
Here is an example of the pins I have used & an example of the GUI : http://robotcontrol.yolasite.com/robotics-forum.php#bn-forum-1-1-4078249718/6874 .

Thank you & regards,
Riaan Deyzel

Here is the current scetch which I modified to change the pan servo to pin 9

Code:

// Importa a biblioteca Servo.h do arduino
#include <Servo.h>

// Cria uma variavel do tipo Servo que será
// o nosso servo.
Servo servo1;

// Array de char que receberá o comando
// via serial
char buffer[4];

// Variavel que identifica quantos
// caracteres foram recebidos, pois só é
// possível receber um caracter por vez
int received;

void setup(){

  // Define o baud rate (taxa de trasmissão) como 9600
  Serial.begin(9600);

  // Atribui o servo ao pino 9 do Arduino
  servo1.attach(9);

  // Atribui o valor 0 para a variavel received
  received = 0;

  // Na posição 0 do array, atribui o valor '\0'
  // que identifica onde começa o array
  buffer[received] = '\0';
}

void loop(){

  // Verifica se existe alguma entrada de dados
  // disponivel na entrada serial
  if(Serial.available()){

    // Salva os caracteres no array a cada iteração
    buffer[received++] = Serial.read();

    if(received >= (sizeof(buffer)-1)){

	// Imprime na saída serial o valor
	// Apenas para mostrar o valor
	Serial.println(buffer);

	// Converte o valor de "char" para "int"
	int numero = atoi(buffer);

	// Envia o comando para o Servo Motor
	servo1.write(numero);

	// Zera novamente a variavel
	received = 0;
    }

    // Limpa o buffer da entrada serial
    Serial.flush();

  }

}

That was the easy part, now I need to add support for an second servo “tilt servo” on pin 10, I can copy the code & buttons from the pan buttons and use them for the tilt buttons, but not sure how to link it to the scetch from the C# app, as the same servo on Pin 9 would probabbly move when I press the Tilt (up/Down Buttons). (See link in above post for source code & original Scetch)
Can anyone please help with this?
Thanks :frowning:

Hello.

It looks like you are reading from a serial port with your sketch. You need to make your C# application write commands to the serial port, and then have your sketch execute the commands that it reads.

- Ryan