Compiling HeaterMeter under Visual Studio/Visual Micro environment


 

Dave Casazza

TVWBB Fan
Has anyone tried the new Visual Studio/Visual Micro build environment?

I'm running Visual Studio 2010 Ultimate, with Visual Micro under Arduino 1.0.3.

After setting the location of the arduino.exe, and opening the project, downloaded from Bryan's code base as of 3/23/2013, I've tried compiling.

I get the following errors:

Compiling 'heatermeter' for 'Arduino Mega 2560 or Mega ADK'
hmcore.cpp : : In function 'void lcdPrintBigNum(float)':
hmcore.cpp : 'class ShiftRegLCDSPI' has no member named 'write_P'
hmcore.cpp : 'class ShiftRegLCDSPI' has no member named 'write_P'
hmcore.cpp : : In function 'void lcdDefineChars()':
hmcore.cpp : 'class ShiftRegLCDSPI' has no member named 'createChar_P'
hmcore.cpp : : In function 'void hmcoreSetup()':
hmcore.cpp : 'PRR' was not declared in this scope
Error compiling

Any thoughts on what I'm doing wrong?

Thanks,
 
I use Visual Micro exclusively now days to compile, love it! Looks like you need to change the target board to Arduino Uno, at least for the PRR. The missing _P functions... maybe that's me. Let me know if it compiles once you switch the target board.
 
I blew up my 328P and I've breadboarded a mega for a smoke this weekend.

Any ideas about what I can change in the code to complete a smoke for tomorrow?

Thanks,

Dave
 
You can just comment out the PRR line, it just saves a few uA. When I do that it compiles fine on my system. Do you have the latest source code? I know I added the _P stuff to the LCD library not too long ago. Make sure the library that's getting compiled in has them.
 
Works great, thank you!

What does the line PRR = bit(PRTWI); do?

Both PRR and PRTWI don't seem to be defined in the source files...
 
The PRR is the power reduction register, you set bits in it to turn on and off various units on the microcontroller. I'm sure the reason it isn't defined for the mega is that there's more than one register because it has so many units so it is named something else.
 
Hi Bryan,

I've noticed that when I set a breakpoint in the visual studio environment, and select when hit, print a label in the debugging output window - i get a conflict where the debugging output doesn't show up, and the normal HM serial output is truncated when viewing the come port. Have you seen this problem?

Thanks,

Dave
 
I haven't used the debugger very much. It was hit or miss if it would do anything back when I was beta testing it, and my HeaterMeter is always attached to a rPi so the serial port is taken. I usually just use the HeaterMeter's Debug_begin(); SerialX.print("I'm a debug statement"); Debug_end(); which shows up in the web browser's javascript console. It's not good for things being called a lot though.
 
I got the visual micro debugging environment running, and there were a couple of things I had to do:

1) I had to break up the Main() function call code into Setup() and Loop(). Didn't permit the debugger to properly reporting on values.

2) I had to disconnect TX/RX from rPI to get it to flash from the computer.

The debugging environment seems ok, except that it doesn't really mimic the classic IDE of Visual Studio. Other problems are that small float numbers are not reported properly (like the Steinhart variables).
 
Last edited:

 

Back
Top