Main Site Documentation

Getting LCD display to compile


#1

I have a brand new cobra board & 7 inch display…i tried the example in the manual/brochure (http://www.ghielectronics.com/downloads/FEZ/Cobra/Broch_FEZ_7inTFTDisplayKit.pdf), step-by -step:
add:
GHIElectronics.NETMF.Hardware
Microsoft.SPOT.Touch

but I get the following error:

Error 1 The name ‘Resources’ does not exist in the current context C:\Users\norm\AppData\Local\Temporary Projects\MFWindowApplication1\Program.cs 89 25 MFWindowApplication1

referring to this program line:

text.Font = Resources.GetFont(Resources.FontResources.small);

I have spent several hours messing with this to no avail…what resource is missing, where is it. & how do I include it? Or is there something else wrong entirely? It seems like this demo should be simple, but what is the secret?


#2

Welcome to the community.

Please click on tutorial link on navigation on top and then see “loading resources”


#3

Thanks Gus, but I already spent quite a bit of time going through the loading resources documentation…a few questions.

A) What exact resource is supposedly missing??.. this is a demo program, so i don’t know what was included or missing.

B) If the resource is missing, where is it located, or how do you find it? Or was it accidentally left out altogether?

C) How do you add it…if A & B are answered, that would be a major step forward.


#4

I know the documentation says to start with a “Window Application”, but you might try starting with a “FEZ Cobra Window Application”. The FEZ project templates are what you normally start with and they have the normal resources already referenced. I don’t have a Cobra, so this is a bit of a shot in the dark…


#5

The doc also says:

[quote]Add these two libraries to the project:
GHIElectronics.NETMF.Hardware
Microsoft.SPOT.Touch[/quote]

Are they the ones you added?


#6

You said the error is on the line that gets a font from resources. You need to add a font to your resources.

The easiest way for this, start with standard window application, which already includes one or 2 fonts then you can modify the code with what we provide. I do not recommend this.

Another way is to copy one of the fonts from one of the provided examples to your project. This is the right option, not the one I pointer earlier.

How to add a resource? The link I pointed before http://wiki.tinyclr.com/index.php?title=Loading_Resources
Where to find font file (small.tinyfont is what the example uses)? It is here C:\Users\Gus Issa\Documents\Microsoft .NET Micro Framework 4.1\Samples\Puzzle\Puzzle\Resources


#7

I found the problem…

When I started my demo project I gave it my own name (LCDtest)…rather than the suggested name of )LCD_Example_7_Inch) & just pasted in the sample code

Never thought that giving it my own name would cause such a headache.—might want to point this out in the documentation.