Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) LiquidCrystal variable type? (Read 3827 times)
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
LiquidCrystal variable type?
Apr 6th, 2014 at 2:15pm
Print Post  
Just spent last evening (and part of the night) uninstalling, and re-installing Atmel Studio 6 Version 6.1.2730 (sp2 win32NT), and Visual Micro (I assume V5) using the Visual Micro directions only, after spending several days trying to get it to work using several different sets of directions.

I have checked and rechecked everything and it is set up exactly the way described.

Finally it 'sort of' appears to be 'trying' to work. However, when using the LiquidCrystal.h I get the following:

Compiling 'WORKING' for 'Arduino Mega or Mega 2560 w/ ATmega2560 (Mega 2560)'
WORKING.ino:11: error: 'LiquidCrystal' does not name a type
WORKING.ino:In function 'void setup()'
WORKING.ino:21: error: 'lcd' was not declared in this scope
WORKING.ino:In function 'void loop()'
WORKING.ino:32: error: 'lcd' was not declared in this scope
Error compiling

Using the following ino code:

#include <Arduino.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(7,8,9,10,11,12);

byte array[20];
byte index = 0;
byte inByte;


void setup(){
   
   
  lcd.begin(20, 4);
  lcd.write("lcd test");
   
  Serial.begin(9600);
}

void loop()
{
  // when characters arrive over the serial port...
  if (Serial.available()) {
       delay(100);
       lcd.clear();
      
      while (Serial.available() > 0) {
      inByte = Serial.read();
      
      if (Serial.peek() == 13) {
        Serial.write(array,index);
        index = 0;
      }
         
      else {    
        //lcd.write(inByte);
        array[index] = inByte;
        index++;
        array[index] = 0;
      } 
    }
  }
}

I do realize the above source has some items in the setup and loop that seem odd. It is not expected to be working code in this iteration, I'm just using it in an attempt to get a successful compile in VS6/VisualMicro. It does compile in the Arduino IDE.

I am a bit new to cpp, but in the distant past did quite a bit of C, as well as a great deal of assembly (for x86, x386, TI7000 and 6510), as well as some limited Visual Basic for some quick and dirty solutions to immediate needs in the very recent past.

I had many of problems I find in the forum, such as inability to find libraries, etc, despite having set the full paths (I never trust relative paths in an IDE), etc.

Anyone have this issue with the LiquidCrystal variable type? Any suggestions?


  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LiquidCrystal variable type?
Reply #1 - Apr 6th, 2014 at 4:18pm
Print Post  
Hi Clay,

Yes the arduino way of #includes without path can usual cause this problem especially if another library in the sketchbook folder\libraries contains a file of the same name. The latest release of visual micro provides more control over this.

Your code compiles fine for me in Visual Micro using both arduino 1.0.x and arduino 1.5.x so I expect we are hitting this library location problem

1)
The latest version of Visual Micro allows #includes to contain the library folder name such as:-

#include <LiquidCrystal\LiquidCrystal.h>

2)
If you don't want to make use of the path in the #include then we can find out why your system fails by enabling tools>options>visual micro>compiler>verbose. The output should show the problem. 

3)
Your Visual Micro version is also show in tools>options>visual micro>version>version

btw: You can force a clean compile by clicking "Build>Clean Solution"
  
Back to top
IP Logged
 
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
Re: LiquidCrystal variable type?
Reply #2 - Apr 7th, 2014 at 1:47am
Print Post  
I forced a clean compile, and turned on verbose output with this result:

Compiling 'WORKING' for 'Arduino Mega or Mega 2560 w/ ATmega2560 (Mega 2560)'
Build folder: Data/VMicro/Arduino/Builds/WORKING/mega_atmega2560
SketchLibFolders
G:\Program Files\Arduino\hardware\arduino\avr\cores\arduino;G:\Program Files\Arduino\hardware\arduino\avr\variants\mega;g:\program files\arduino\hardware\tools\avr\avr\include\;g:\program files\arduino\hardware\tools\avr\avr\include\avr\;g:\program files\arduino\hardware\tools\avr\avr\;g:\program files\arduino\hardware\tools\avr\lib\gcc\avr\4.3.2\include\;
Summary: Header=1 Prototypes=3 Imports=2
Additional Defines: VISUALMICRO_COMPILER_VER=1;
Architecture Tools: G:\Program Files\Arduino\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///G:/Documents%20and%20Settings/Clay.Routh/My%20Documents/Arduino
"G:\Program Files\Arduino\hardware\tools\avr\bin\avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=150 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"G:\Program Files\Arduino\hardware\arduino\avr\cores\arduino" -I"G:\Program Files\Arduino\hardware\arduino\avr\variants\mega" "G:\Documents and Settings\Clay.Routh\Local Settings\Application Data\VMicro\Arduino\Builds\WORKING\mega_atmega2560\WORKING.cpp" -o "G:\Documents and Settings\Clay.Routh\Local Settings\Application Data\VMicro\Arduino\Builds\WORKING\mega_atmega2560\WORKING.cpp.o" -DVISUALMICRO_COMPILER_VER=1
WORKING.ino:11: error: 'LiquidCrystal' does not name a type
WORKING.ino:In function 'void setup()'
WORKING.ino:21: error: 'lcd' was not declared in this scope
WORKING.ino:In function 'void loop()'
WORKING.ino:32: error: 'lcd' was not declared in this scope
Error compiling

It has been a very long time since I was programming C code, and C++ didn't seem very foreign. I began digging through the LiquidCrystal.cpp source, and I can see I have a great deal of research to do before I ever write an include of my own LOL! And I found no reference to the variable "lcd" in it.
  
Back to top
 
IP Logged
 
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
Re: LiquidCrystal variable type?
Reply #3 - Apr 7th, 2014 at 2:05am
Print Post  
Looking in the project properties, I noted that the LiquidCrystal.h was not in any of the paths and of course, not thinking I added it to the C compiler rather than the C++, rebuilt and noted the path wasn't in the output, so I copied the include file to the cores directory and now it compiles with no errors. It wasn't until I was already writing this post that I noted my mistake (adding it to the C, rather than C++ compiler directory properties). Maybe I'll go delete it from cores, and add the path to the correct property and see what happens.
  
Back to top
 
IP Logged
 
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
Re: LiquidCrystal variable type?
Reply #4 - Apr 7th, 2014 at 2:17am
Print Post  
I doesn't seem "coherent" to me for the libraries to be scattered out in all these directories... I wonder why they do that?

Now maybe I'll download your debugging stuff and see if I can get that to work. Main reason I wanted to get VS6 running was  to debug code and have the option of using inline assembly when I wanted/needed to.

Thanks for your help. I owe you a beer.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LiquidCrystal variable type?
Reply #5 - Apr 7th, 2014 at 10:54am
Print Post  
I would not agree that libraries are scattered. There are two places that Arduino allow 1) documents/arduino/libraries 2) ide/libraries.

I am not sure Arduino is the right solution for you but best of luck

  
Back to top
IP Logged
 
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
Re: LiquidCrystal variable type?
Reply #6 - Apr 7th, 2014 at 7:57pm
Print Post  
Perhaps "buried" was not the correct "term". Let's call it "buried". 

And you may be entirely correct (I already figure you ARE correct) that Arduino isn't the right solution for me, but...

Arduino seems like a good place to start re-familiarizing myself with embedded systems, and programming. I did extensive stuff with KD196, and x186 stuff way back when, but it was almost all in assembly. I never worried about C, nor Basic back then (still don't bother much with Basic unless I need something quick and dirty), unless I needed extensive work with math, and even then I simply wrote a C function, and placed my assembly code inside of it, so I could call C math functions from it.

Of course that was back when Turbo C was the hot stuff, as was Microsoft MacroAssembler. Passing variables and return values as well as stack manipulation wasn't to difficult, and writing custom C functions in assembly even made me some $ on the side.

However, I did end up using some C for char string work, etc.

Regardless, I'm re-teaching myself C, C++, and familiarizing myself with Atmel AVR assembly in preparation for what I want to do when I'm a bit closer to retirement, and can no longer carry 60-70lbs of tools, laptop, and test equipment up and down ships (there is serious $ made fixing them, and they are quite complex integrated systems).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LiquidCrystal variable type?
Reply #7 - Apr 7th, 2014 at 8:09pm
Print Post  
You are way ahead of many of us  Smiley Sounds like you have some fun ahead either way.
  
Back to top
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: LiquidCrystal variable type?
Reply #8 - Apr 7th, 2014 at 9:12pm
Print Post  
Clay,

programming in assembler is like driving a car with manual transmission  Smiley. But programming in C/C++ in Arduino is like driving a car with those new automatic transmission with six speeds that you can shift manually  Cheesy.

C is the best assembler ever, and C++ lets you create libraries that can easily be reused (object programming).

And VisualStudio/AtmelStudio + VisualMicro is the best environment to program Arduino  Grin Grin Grin.
  
Back to top
 
IP Logged
 
Clay Routh
Newbies
*
Offline


Posts: 6
Joined: Apr 6th, 2014
Re: LiquidCrystal variable type?
Reply #9 - Apr 16th, 2014 at 10:18pm
Print Post  
Ordered an AVR Dragon... am putting my shopping list together for the various cabling and jumpers I'll need. 

Successfully wired up the 2560 as an adjustable voltage regulator, with LCD readout, and without any tweaking found it was pretty accurate (within .015 volts), but the reaction time is not what I want. So it will require a bit more tweaking.

But I've been in school the last few days so I haven't gotten to play with it much.

And yes, it was all done in C++. The syntax is somewhat different from C, but I suppose I'll get used to that as time goes on.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: LiquidCrystal variable type?
Reply #10 - May 13th, 2015 at 4:36pm
Print Post  
This Topic was moved here from Atmel Studio 6.2 [move by] Visual Micro.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint