Pages: [1]   Go Down
Author Topic: Require help with some code for special character on lcd 128*64 ......  (Read 781 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi to all i am busy with a small project (mega2560-lcd128*64-st7920-serial-spi mode)i would just like to display these special symbols i have created using a bitmap programme (fastlcd)on the display ..have tried using font creators to get the hex for the custom characters but how do i insert it into the *.h/ *.cpp file so that it will display ... I dont even know if the hex is correct ..i noticed there are two files attached to project im setting up with help of another friend.... namely font10x10  & font16x16....if that helps any ..

It is basically a Thermometer symbol with  a small bargraph inside it that represents temparature basically in 6 blocks in height , 20-80 degrees in three steps i have no clue on that code either using lm35 sensors via the anologue pins ...

* Added a picture of what i am trying to get drawn on lcd attached to this message (bitmap)
* Tried using drawroundrect but get error message when compiling ..basically that the command im using is not a member of *.h....

* Am new to all of this any or some help would be very much appreciated ...


* thermobit maps x3.BMP (1.06 KB, 128x64 - viewed 68 times.)
« Last Edit: August 16, 2012, 12:13:27 am by sam_cqdx » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49040
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Tried using drawroundrect but get error message when compiling ..basically that the command im using is not a member of *.h
Commands aren't members of any class. Methods are. So, you can only use the methods that are part of the class that you have an instance of.

Since you didn't explain what class you are talking about, nor did you explain what instance of that class you have created nor what member you are trying to call, nor specifically what errors you got, the best we can do is wish you luck.

Good luck.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok i have gotten a better copy  of the code in trying to integrate ...perhaps this can help

Im trying to implement this code into the program :


                //read LM35 temperature sensor data     
                //DrawRoundRect(63, 28, 52, 30, 10, BLACK);
                GLCD.GotoXY(75,40);
                //x = 0.48876 * analogRead(SENSOR); //this use 1k of memory
                x = (analogRead(SENSOR)>>1)-1; //We need more memory!!!!
                GLCD.PrintNumber(x);   
                GLCD.Puts(";");
       
                //Termo Graphic
                GLCD.DrawRoundRect(120, 39, 5, 22, 2, BLACK);
                x /= 3; //22*3 => 66 max temperature on graph
                GLCD.FillRect(122, 61 - x, 1, x, BLACK); //61=39+22
        }
the error i get is the following :

psu_controller_sam_modified.cpp: In function 'void updateDisplay()':
psu_controller_sam_modified:449: error: 'GLCD' was not declared in this scope
psu_controller_sam_modified:451: error: 'x' was not declared in this scope
psu_controller_sam_modified:451: error: 'SENSOR' was not declared in this scope
psu_controller_sam_modified:456: error: 'BLACK' was not declared in this scope
psu_controller_sam_modified:463: error: 'circSymbol1' was not declared in this scope
psu_controller_sam_modified:463: error: 'circSymbol2' was not declared in this scope
psu_controller_sam_modified:466: error: 'BLACK' was not declared in this scope
psu_controller_sam_modified:466: error: 'DrawRoundRect' was not declared in this scope
psu_controller_sam_modified:467: error: 'x' was not declared in this scope
psu_controller_sam_modified:468: error: 'FillRect' was not declared in this scope
psu_controller_sam_modified:493: error: 'updateTime' was not declared in this scope
psu_controller_sam_modified.cpp: At global scope:
psu_controller_sam_modified:499: error: expected declaration before '}' token

Hope this is more specific ...thanks  again ...
       
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49040
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"Snippets are us" is down the road a ways. We expect to see ALL of your code. Without it, all we can do is agree that the compiler it right.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To the previous poster i could not enclose my code here as it is to big (9500 characters max) i mailed you  via the board.
Thanks for the reply
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can attach the code to the post. Click 'Additional Options...' under the text input box.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok i have gotten a better copy  of the code in trying to integrate ...perhaps this can help

Im trying to implement this code into the program :


                //read LM35 temperature sensor data    
                //DrawRoundRect(63, 28, 52, 30, 10, BLACK);
                GLCD.GotoXY(75,40);
                //x = 0.48876 * analogRead(SENSOR); //this use 1k of memory
                x = (analogRead(SENSOR)>>1)-1; //We need more memory!!!!
                GLCD.PrintNumber(x);    
                GLCD.Puts(";");
        
                //Termo Graphic
                GLCD.DrawRoundRect(120, 39, 5, 22, 2, BLACK);
                x /= 3; //22*3 => 66 max temperature on graph
                GLCD.FillRect(122, 61 - x, 1, x, BLACK); //61=39+22
        }
____________________________________________________________

* lcd7920.h (5.29 KB - downloaded 13 times.)
* lcd7920.cpp (12.26 KB - downloaded 17 times.)
* glcd16x16.cpp (21.68 KB - downloaded 16 times.)
« Last Edit: August 23, 2012, 09:09:34 am by sam_cqdx » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the last file added to complete the code

* glcd10x10.cpp (17.55 KB - downloaded 10 times.)
« Last Edit: August 23, 2012, 08:39:32 am by sam_cqdx » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49040
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The compiler is absolutely right. Look for GLCD in your sketch. The only occurrence is in a comment.

You must create an instance of the lcd class, and do the drawing on that instance.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

WIll do so Paul ..thank you
Logged

Pages: [1]   Go Up
Jump to: