03-10-2015, 09:08 AM
Good, we now have output.
What the application is doing is "every time it determines that the clock line has changed from 1 to 0 it prints the value of the micro timer". The micro timer is simply a counter telling us the number of microseconds that have elapsed since the program started. We can safely ignore the timer overflow that occurs every 70 minutes of so.
What the output says is that at 62008, 2109720, 4157352, 6205176 and 8252628 microseconds, or about every 2 seconds, the clock changed from a 1 to a 0 and the value of the data line when this happened was 1.
Based on the information we have from the instructable and Yuri's site we were expecting transitions in the "several thousand transitions per second" range, not the "once every 2 seconds" we are seeing.
The only conclusion I can draw from this is that the clock input on the Arduino is still not getting the correct clock information from the caliper.
You might try changing the sense of the clock transitions ... from 0 to 1 rather than from the current 1 to 0 and see what we get. Change the line:
if (lastClock == 1 && clock == 0) {
to
if (lastClock == 0 && clock == 1) {
and rerun the application. But I am not expecting any great insight to come from it.
What the application is doing is "every time it determines that the clock line has changed from 1 to 0 it prints the value of the micro timer". The micro timer is simply a counter telling us the number of microseconds that have elapsed since the program started. We can safely ignore the timer overflow that occurs every 70 minutes of so.
What the output says is that at 62008, 2109720, 4157352, 6205176 and 8252628 microseconds, or about every 2 seconds, the clock changed from a 1 to a 0 and the value of the data line when this happened was 1.
Based on the information we have from the instructable and Yuri's site we were expecting transitions in the "several thousand transitions per second" range, not the "once every 2 seconds" we are seeing.
The only conclusion I can draw from this is that the clock input on the Arduino is still not getting the correct clock information from the caliper.
You might try changing the sense of the clock transitions ... from 0 to 1 rather than from the current 1 to 0 and see what we get. Change the line:
if (lastClock == 1 && clock == 0) {
to
if (lastClock == 0 && clock == 1) {
and rerun the application. But I am not expecting any great insight to come from it.