2/15/2024 0 Comments Rectangle Pro downloadingThe setTextWrap function is responsible for breaking the line if it reaches the limit of the screen. The setTextSize function is responsible for assigning a size to the text that will be written. We have two ways to use it: void setTextColor (uint16_t c) // sets the color of writing onlyvoid setTextColor (uint16_t c, uint16_t bg) // set the writing color and background color The setTextColor function is responsible for assigning a color to the text to be written. The setCursor function is responsible for positioning the cursor for writing to a given point. The fillScreen function is responsible for filling the screen with a single color. void fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) The fillCircle function is the same as drawCircle, but the circle will be filled with the given color. void drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) The drawCircle function is responsible for drawing a circle from a source point and a radius. The fillTriangle function is the same as drawTriangle, but the triangle will be filled with the given color. The drawTriangle function is responsible for drawing a triangle on the screen, passing the point of the 3 vertices. void fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) The fillRoundRect function is the same as drawRoundRect, but the rectangle will be filled with the given color. void drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) The drawRoundRect function is the same as drawRect, but the rectangle will have rounded edges. void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) The fillRect function is the same as drawRect, but the rectangle will be filled with the given color. void drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) The drawRect function is responsible for drawing a rectangle on the screen, passing a point of origin, its height and width. void drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) The drawFastHLine function is responsible for drawing a horizontal line from a point and a width. void drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) The drawFastVLine function is responsible for drawing a vertical line from a point and a height. The drawLine function is responsible for drawing a line from two points. void drawPixel (int16_t x, int16_t and, uint16_t color) The drawPixel function is responsible for painting a single point on the screen at the given point. Now let's take a look at some graphical functions that libraries can offer us. Serial.print("Y: ") Serial.println(touchPoint.y) Serial.print("X: ") Serial.println(touchPoint.x) TSPoint touchPoint = ts.getPoint() //pega o touch TouchScreen ts = TouchScreen(XP, YP, XM, YM) objeto para manipulacao dos eventos de toque na tela #include //Portas de leitura das coordenadas do touchvoid These values are important for mapping the touch to the graphic points on the screen. Using a simple program to get the touch points on the display, store the value of the points (x, y) at each end (highlighted in yellow in the figure below). Unzip the file and paste it into the libraries folder of the Arduino IDE.Ĭ: / Program Files (x86) / Arduino / librariesīefore we start our program, we need to address something important: the TOUCH calibration. Click on the links and download the libraries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |