So I’m working on making an Arduino Uno produce an infinitely looping sawtooth design. I want to be able to pull up the serial plotter and have the line displayed there.
However, I do believe that my problem lies within the error “‘screen’ was not declared in this scope”. I’m new to Arduino/C++ coding so I don’t quite know what this means and googling does not seem to help for my problem either.
As of right now, my code seems to be infinitely increasing, instead of dropping back down to 0 after 250 units. The highlighted line is number 17, the first “screen.line.”
My error lines (below the coding window, whatever this is called) has the following:
In file included from C:\Users\Connor\Desktop\Arduino\libraries\TFT\src/TFT.h:36:0,
C:\Users\Connor\Desktop\Arduino\libraries\TFT\src/utility/Adafruit_GFX.h:60:3: warning: #warning “The SD library was not found. loadImage() and image() won’t be supported.” [-Wcpp]
#warning “The SD library was not found. loadImage() and image() won’t be supported.”
C:\Users\Connor\Desktop\Sawtooth_Design\Sawtooth_Design.ino:19:0: warning: “x_dimension” redefined
#define x_dimension new_x_dimension //defines the first x-point as the second x-point from this loop
C:\Users\Connor\Desktop\Sawtooth_Design\Sawtooth_Design.ino:10:0: note: this is the location of the previous definition
#define x_dimension 0 //set the original x-point to 0
C:\Users\Connor\Desktop\Sawtooth_Design\Sawtooth_Design.ino: In function ‘void loop()’:
Sawtooth_Design:17: error: ‘screen’ was not declared in this scope
screen.line(x_dimension,0,new_x_dimension,250); //Draws a line with a slope of +1
exit status 1
‘screen’ was not declared in this scope
I believe that I attached my code below. I first learned to program in Matlab, so it may be that I am trying to make it work like Matlab, even though it is Arduino. Any help would be greatly appreciated!
Sawtooth_Design.ino (758 Bytes)