Automated Dust Collection

Actually the exit; does nothing but throw this warning.

...\arduino_modified_sketch_800891\sketch_may17b.ino: In function 'void setup()':

C:\Users\DaD\AppData\Local\Temp\arduino_modified_sketch_800891\sketch_may17b.ino:9:11: warning: statement is a reference, not call, to function ‘exit’ [-Waddress]
…\arduino_modified_sketch_800891\sketch_may17b.ino:9:11: warning: statement has no effect [-Wunused-value]

The exit(0) function would exit loop, disable interrupts and freeze.

That code is in loop(), not in setup(). Why does the compiler think it is in setup()?

I installed the Adafruit PWM Servo library (against my better judgement) and do not get any errors:

Build options changed, rebuilding all
Sketch uses 9122 bytes (3%) of program storage space. Maximum is 253952 bytes.
Global variables use 659 bytes (8%) of dynamic memory, leaving 7533 bytes for local variables. Maximum is 8192 bytes.

I did not say [u]error.[/u]

Do you have all warnings turned on in Preferences? I installed the Adafruit library and compiled his code and got the same warning.

Warnings. Errors. I don't care. I don't release code with warnings.

Show verbose output during compilation is checked and Compiler warnings is set to ALL.

Why would it freeze? Exit() would just bail from loop() back to main(). It does not sound like it is freezing as the OP is reporting seeing the Serial monitor providing data.

I am using the same code that the original builder of the system used. His system is identical to mine. The only exception is, I will be adding more tools than he did.

Any suggestions on how to fix it and make it work?

Arduino and exit(0) I tried to point out a potential problem. The program flow may not be as desired if the exit (whatever it is supposed to do) is ignored. I'm done.

You make a good point, unfortunately you are not speaking with the creator of the program so it is landing on partially deaf ears.

On another note, I don’t think I have ever used exit.

As for me helping fix it. I can, later. It is becoming a larger issue. Perhaps the OP can contact the author for direct assistance?

I attempted to contact the original author a couple of months ago. He hasnt replied. The only way to contact him is by twitter. This is probably he only project I will do with the arduino. I wouldnt mind paying someone to rewrite the code or what ever is necessary to make this work. Can you point me in the direction of someone who can do that?

First try replacing the exit statements with break statements. The intent seems to be to break out of the for loop at those points. Worth a try.

for(int i=0;i

I tried that, didnt work

Then how about following the suggestion from quite a few posts ago to post the output you see on the Serial monitor (between CODE tags!) around the time you switch on the tool. That could be quite helpful in trying to follow what's happening in that code.

How do I do that?

Just copy/paste from the Serial monitor.

I have to hit the scroll box to stop scrolling, then hit 'crtl a' to select then 'ctrl c' to copy

Miter Saw: 0.07 Amps RMS
Table Saw: 4.02 Amps RMS
Miter Saw: 0.07 Amps RMS
Band Saw: 4.24 Amps RMS
Miter Saw: 0.07 Amps RMS
openGate 0
openGate 1
closeGate 2
openGate 3
closeGate 4
closeGate 5

Miter Saw: 0.07 Amps RMS
Table Saw: 3.83 Amps RMS
Miter Saw: 0.07 Amps RMS
Band Saw: 4.05 Amps RMS
Miter Saw: 0.07 Amps RMS

Miter Saw: 5.43 Amps RMS
Table Saw: 4.19 Amps RMS
Miter Saw: 5.40 Amps RMS
Band Saw: 4.62 Amps RMS
Miter Saw: 5.36 Amps RMS

Miter Saw: 5.36 Amps RMS
Table Saw: 4.37 Amps RMS
Miter Saw: 5.36 Amps RMS
Band Saw: 4.11 Amps RMS
Miter Saw: 5.36 Amps RMS

Miter Saw: 5.36 Amps RMS
Table Saw: 4.38 Amps RMS
Miter Saw: 5.36 Amps RMS
Band Saw: 4.15 Amps RMS

it isnt sending a signal to the relay to turn the dust collector on.

Is this still the issue?

I wired up a test circuit on my Uno and ran the code from post #6. I used a LED on pin 11 to watch the dust collector relay output. When one of the analog inputs goes high the LED does turn on and then LED turns off, after a delay, when the input is brought low. So, the code seems to be working. If the relay is not turning on it is looking like a hardware problem.

Ok. Stupid question. Does the led go on pin 11 and ground

I connected a led to pin 11 and ground. The led came on as soon as I connected it

Are all of the analog inputs that you are using at near 0V? If any are floating (or high) that could turn on the LED.

@gladewater2016, any chance of posting pictures of your setup?