Open eimix opened 5 years ago
I asked myself the same question. I removed the nano and directly used ADC to read volts and amps, it's works!!!
@lucabiasotto do not hesitate to share your modifications with us :-)
Hi @comperta, i connect the volt sensor to the A2 pin of the mega, then:
ADCMan.run()
: ADCMan.setCapture(A2, 1, false);
Comment the code where you read RawValueVolt
from nano.
finally you can use RawValueVolt = ADCMan.read(A2)
for get the volt value.
I have a question for you, I don't understand what is the advantage of using ADCMan library. Do you think we could do everything with analogRead? Thanks :)
In library adcman/adcman.h is written: "- WARNING: never use any 'analogRead()' in your code when using this class!"
This warning prevents using standard arduino functions, but it provides it's own functionality. Analog inputs could be read using this library:
Setup ADC pin: ADCMan.setCapture(pinMotorMowSense, 1, 1); Program loop:
ADCMan.run(); if (ADCMan.isCaptureComplete(pinMotorMowSense)){ int value = ADCMan.read(pinMotorMowSense); }
Is there any other limitation that makes Nano board necessary?