New answers tagged


Your sketch works on a Nano (clone) that I have I am using a high-brightness white LED with a 10kΩ resistor to bring the brightness down to a bearable level, so the current drawn is about (5v-2.2v)/10kΩ = 0.28mA. This is a low level of current and should be safe for poking around with. I can see the embedded LED blink if I program the Pin 13, but no impact ...


here's the c++ code vector<int> b={1,0,1,0,1,0,1}; int sum=0; for(int i=b.size()-1, j=0; i>=0; i--, j++){ sum+=b[j]*(1<<i); } return sum;


The ADC measures a voltage ratio. The conversion result is the rounded value of 1024×V/Vref, where V is the voltage at the input and Vref is the voltage reference. In the default Arduino configuration, the reference is connected to Vcc. This will not fit your use case, as the voltage you want to read does not vary proportionately to Vcc. You could use an ...


In your setup you may need pinMode(A0, INPUT); At least, that seemed to fix a similar problem I was having.

Top 50 recent answers are included