Code Module 3-3-3b

I copied the code from Github and getting the attached error message:

Any guidance appreciated,


Hey Paul,

The #include macro, #define constants and pinBatt variable declaration need to sit outside the setup function at the very top.

Declaring pinBatt outside of the setup loop, means it becomes a global variable which can be accessed by any function in the program. 

So, currently what's in the first loop function, should be in the set up function, and there should be only one loop function.

So code should look like ...

#include <cmdArduino.h>

#define ADC_UNITS 1024
#define ADC_REF_VOLTAGE 3.3

int pinBatt = A6;

void setup() {
  // put your setup code here, to run once:
  pinMode(pinBatt, INPUT);

  Serial.println("Module 3-3 Lab 3a: Battery Status");

  cmd.add("batt", cmdBatt);

void loop() {


Here's some further info on #include libraries, #define constants and global variables if you're interested

# include


Global variables and scope

hope that helps!