Hi, I said I would make a new post for the software of the robot (advised by mehtaatur).

I've began testing my switch matrix and Ive been having a bit of a problem. On the serial monitor I get rows of 8 1's (11111111). And when I put the magnets close some of the 1's turn to 0's. But it does not happen to all of them. I'm not sure if maybe some of my wiring is wrong or maybe some of my switches could be broken?

This is the program I am using.
_______________________________________________________________________________________________________________________________________________________
void setup() {

Serial.begin(9600);
}

void loop() {
Serial.println("Reed Switch Array: \n");
int ColumnDetect[9] = {A5, A4, A3, A2, A1, A0, 11, 10}; //Array with the 8 detection pins in sequence from left to right in diagram
for (int i=2; i { // connect to pins 2, 3, 4, 5 , 6, 7, 8, 9 here - VCC
digitalWrite(i, HIGH);

for (int j=0; j { // connect to pins in ColumnDetect array in order - Reads signal from here
Serial.print(digitalRead(ColumnDetect[j]));
}

digitalWrite(i, LOW);
Serial.println();
}

Serial.println("\nEND \n");
}

My Internet is not working on my laptop tonight so when I get it back I will upload more detailed photos.

wvantoorn

9 years 6 months ago

Cannot see the picture very good, but i would say check your wiring, if that little program says only some turn on and off, then it would be right.
I also see, but dont know the schematics, that some wires attached to the small lines are soldered to 2 differen points, on the left side of the picture, the soldering between the 2 parts of the board seem to be connected to different points.

But the only way is to take the multimeter and check every point.
Goodluck and looks like its going to be a very interesting project to follow!

I had another look at my wiring and changed the wires as I thought that was the problem. 

(I just realised that I used the wrong colour wires for rows and columns, not that it makes any difference)

But even with this I am getting the same results. Sometimes if I move around the arduino board with my hand some of the switches do change, does this mean it is probably bad connections?

My motors are using toothed belts and pulleys to move my carriage's in each direction. The slides are slightly stuff and from carrying out some tests I think it would be best if the motors are driven quite slowly to get the most torque and the best movement. 

GroG

9 years 6 months ago

In reply to by Paddymcd

Ahoy Paddymcd..

Here's a script I put together for you...

[[home/Paddymcd/chessgame.py]]

You'll see in the video what the script does.

It starts ChessGame, Arduino and Serial service.
It subscribes Python service to the ChessGame's publishMove event - the data in the parameter is a String.
The String contains a "x", a from & too coordinates, then a "n" or an "i" .. I believe "i" is illegal move and "n" is normal? 

It then breaks the coordinates up and re-maps them to numbers of steps (I was guessing a 100 steps between squares - but its probably less)  

The stepper stuff is commented out because its not implemented yet.. you might want to defer to mehtaatur and send the data to the Arduino where it could be consumed by some stepper library.

Thanks Grog, from your video it looks to be workign very well. 

You said in your email that I must have the latest myrobotlab.jar, but when I download from the link you have given I do not get any services available and the whole thing freezes. The version I have been using all along is gui 1.0.99, is this an older version? 

Also when I paste the MRLComm.ino version 21 into my Arduino IDE I get the following errors.

Arduino: 1.6.1 (Windows 8.1), Board: "Arduino Uno"
 
sketch_apr07a.ino: In function 'void loop()':
 
sketch_apr07a.ino:856:13: error: 'struct stepper_type' has no member named 'step0'
 
sketch_apr07a.ino:857:13: error: 'struct stepper_type' has no member named 'step1'
 
sketch_apr07a.ino:1181:27: error: 'struct stepper_type' has no member named 'step1'
 
sketch_apr07a.ino:1183:27: error: 'struct stepper_type' has no member named 'step1'
 
sketch_apr07a.ino:1189:27: error: 'struct stepper_type' has no member named 'step1'
 
sketch_apr07a.ino:1191:27: error: 'struct stepper_type' has no member named 'step1'
 
Error compiling.
 
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
 
Im not sure, might I be doing something incorrectly? 

Guess that those wires put in the arduino dont make full contact, and if you wiggle them on the arduino and the go on, yeah you have some bad connections. Try if you can get some male headers and solder the wires to them, makes a much better connection.