Skip to content
Snippets Groups Projects
Commit 52eee00c authored by Lingxin Meng's avatar Lingxin Meng Committed by Elisabetta Pianori
Browse files

Revert "Remove a serial print"

This reverts commit faab515cdb0638f48ec5d675bbbe235888581e58.
parent aa5afec6
No related branches found
No related tags found
No related merge requests found
#if defined(ARDUINO_AVR_UNO)
static const uint8_t analog_pins[] = {A0,A1,A2,A3,A4,A5}; //Arduino Uno
#elif defined(ARDUINO_AVR_MEGA2560)
static const uint8_t analog_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15}; //Arduino mega
#endif
#include "Wire.h"
#include "devcomuino.h"
const unsigned int MAXARGS=5;
const unsigned int MAXBYTES=16;
......@@ -91,32 +92,14 @@ void cmdHELP()
void cmdADC(int channel)
{
float V;
switch(channel)
{
case 0:
V=analogRead(A0);
break;
case 1:
V=analogRead(A1);
break;
case 2:
V=analogRead(A2);
break;
case 3:
V=analogRead(A3);
break;
case 4:
V=analogRead(A4);
break;
case 5:
V=analogRead(A5);
break;
default:
Serial.println("ERR invalid channel");
break;
}
Serial.println(V);
if (channel < sizeof(analog_pins)) {
V=analogRead(analog_pins[channel]);
Serial.println(V);
}
else {
Serial.println("ERR invalid channel");
}
}
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment