How Best to Test

Hey Guys,

I bet theres already a thread out there for this question but I could not find it so if you could point me in that direction that would be great.

I have a decilima Im trying to use with an H-bridge to run a motor, and its not working. Whats the best way to troubleshoot? How can I tell if the outputs I think are high are actually high?

Thanks, Poohshoes

as an aside, is there a build in led and if so how do i reference it in the code?

So I got a Voltmeter and set it to DC and 20V (it was that or 2), and when I set the pin to low I get 5 on the voltmeter, and when I set it to HIGH I get 0, am I crazy? I think the power in my hbridge may be wired wrong or maybe just the wires in my brain.

Im using the 5v power as the to make a circut to test for high/low.

This is a diagram of my wiring except I have the Decilima board and only one ground hooked up, anybody have any ideas?

And heres the code:

int motor1Pin = 3;    // H-bridge leg 1 
int motor2Pin = 4;    // H-bridge leg 2 
int speedPin = 9;     // H-bridge enable pin 

void setup() {

  // set all the other pins you're using as outputs:
  pinMode(motor1Pin, OUTPUT); 
  pinMode(motor2Pin, OUTPUT); 
  pinMode(speedPin, OUTPUT);

  // set speedPin high so that motor can turn on:
  digitalWrite(speedPin, HIGH); 
  digitalWrite(motor1Pin, LOW);   // set leg 1 of the H-bridge low
  digitalWrite(motor2Pin, HIGH);  // set leg 2 of the H-bridge high

void loop() {


I don’t understand exactly how H-Bridges work so I don’t have experience, but start with the obvious,

Why not just switch your code around to output a LOW when you want them on and a HIGH went you want em off?
Sure it might get confusing, but noone else seems to be giving answers.

Thanks for the response lilpunk, I did however try that already to no avail.

I am dooing the more complicated model that lets you use an h-brige to run the motor both ways. When I get a minute I will switch it around to the simpler just one way version and see what I can do (I think it may make it easier to see if the power is wired up right).