I’m trying Visual Micro with the below. It results in compiler error. Why ? This code compile in the standard Arduino IDE.
The code
#include <OneWire.h>
#include <Arduino.h>
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int lcd_key =0;
int adc_key_in =0;
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnNONE 5
// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 16
int read_LCD_buttons()
{
adc_key_in = analogRead(0);
if (adc_key_in > 1000)
return btnNONE;
if (adc_key_in < 50)
return btnRIGHT;
if (adc_key_in < 195)
return btnUP;
if (adc_key_in < 380)
return btnDOWN;
if (adc_key_in < 555)
return btnLEFT;
if (adc_key_in < 790)
return btnSELECT;
}
void setup()
{
/* add setup code here */
Serial.begin(9600);
}
void loop()
{
/* add main program code here */
}
The build log (what BSeries.cpp ?)
Compiling ‘Simple’ for ‘Arduino Uno’
Arduino.h : In file included from
BSeries.cpp : from
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const String&)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, char)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, char)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, int)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, int)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ here
WString.h : declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long unsigned int)’ conflicts with
WString.h : previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ here
BSeries.cpp : In file included from
Arduino.h : declaration of C function ‘uint16_t makeWord(byte, byte)’ conflicts with
Arduino.h : previous declaration ‘uint16_t makeWord(uint16_t)’ here
Arduino.h : declaration of C function ‘long int random(long int)’ conflicts with
stdlib.h : previous declaration ‘long int random()’ here
Arduino.h : declaration of C function ‘long int random(long int, long int)’ conflicts with
Arduino.h : previous declaration ‘long int random(long int)’ here
Error compiling