How about this:
hgmjrRich (BB code):if ((xpin > xmin) && (xpin < xmax)){ if ((ypin > ymin) && (ypin < ymax)){ if ((zpin > zmin) && (zpin < zmax)){ ... Turn off relay .... } else { ... Turn on relay .... } } else { ... Turn on relay .... } else { ... Turn on relay .... }
in terms of this.. im not sure if the compiler will like it.. but you can use && i.e.:if(analogRead(xpin, ypin, zpin)>607)
{ digitalWrite(relaypin, HIGH);
if(analogRead(xpin>512)&&analogRead(ypin>512)&&analogRead(zpin>512))
{ digitalWrite(relaypin, HIGH); }
if(analogRead(xpin>600)|| analogRead(xpin<600))
{ digitalWrite(etc..); }
I believe you have hit the nail on the head..... I think my limits might be off.
Yeah. I was hoping for the avialability of a jumper selectable ADC reference voltage but I quickly learned that there was no jumper available.ah yeh of course, didnt think about that either!
thats silly design, it should run off the same voltage, especially on a dev board...
using multiple voltages always makes things confusing:S
or it should have a jumper selection...
Absolutely! its not far off now! it took a big leap forward when you spotted the contention!!Yeah. I was hoping for the avialability of a jumper selectable ADC reference voltage but I quickly learned that there was no jumper available.
Maybe with a few adjustments to the ADC test limits ripcus10 is using and a correction to the programming logic to contend with the three outputs controlling a single output, the overall project will take a turn for the successful.
hgmjr
quite literally! he IS using an accelerometerThe next move is yours, ripcus10.
hgmjr