M5Paper, using canvas in procedure
-
Have wrote a simple program, with a procedure that use canvas.
When compile the program get error message
"canvas1' was not declared in this scope" .This is my program:
#include <M5EPD.h>
void setup() {
M5.begin();
M5.TP.SetRotation(180);
M5.EPD.SetRotation(180);
M5.EPD.Clear(true);
canvas1.createCanvas(960, 540);
canvas1.loadFont("/fonts/GenSenRounded-R.ttf", SD);
DisplayDisplayWindSection(480, 270, 300, 3.5, 40)
canvas1.pushCanvas(0, 0, UPDATE_MODE_GL16);}
void loop() {
// put your main code here, to run repeatedly:}
void drawWindroos()
{
canvas1.loadFont("/fonts/GenSenRounded-R.ttf", SD);
canvas1.createRender(30);
canvas1.setTextSize(30);
}The error is shown in the first line of the procedure drawWindroos.
How to avoid this error?Cheers,
Jan -
@powersoft
Do you only have 1 canvas? Trycanvasinstead ofcanvas1.BTW, you can enclose your code in three back ticks (```) to make it easier for us to read, like this...
this text has three back ticks before and after it
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login