Advertisement
pleasedontcode

**Display Rectangle** rev_01

Dec 23rd, 2024
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: **Display Rectangle**
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2024-12-24 03:33:07
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Create a customizable dashboard on the ILI9488 */
  21.     /* display, allowing users to select and arrange */
  22.     /* widgets for monitoring various system parameters. */
  23. /****** END SYSTEM REQUIREMENTS *****/
  24.  
  25. /* START CODE */
  26.  
  27. /****** DEFINITION OF LIBRARIES *****/
  28. #include <ILI9488.h>    //https://github.com/jaretburkett/ILI9488
  29.  
  30. /****** FUNCTION PROTOTYPES *****/
  31. void setup(void);
  32. void loop(void);
  33.  
  34. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  35. // Create an instance of the ILI9488 display
  36. ILI9488 tft = ILI9488(/* CS pin */, /* DC pin */, /* RST pin */);
  37.  
  38. /****** SETUP FUNCTION *****/
  39. void setup(void)
  40. {
  41.     // Initialize the display
  42.     tft.begin();
  43.     tft.setRotation(1); // Set the rotation of the display
  44.     tft.fillScreen(ILI9488_BLACK); // Clear the screen with black color
  45.  
  46.     // Draw a simple widget (e.g., a rectangle)
  47.     tft.fillRect(10, 10, 100, 50, ILI9488_RED); // Draw a red rectangle
  48.     tft.setTextColor(ILI9488_WHITE); // Set text color to white
  49.     tft.setCursor(15, 15); // Set cursor position
  50.     tft.setTextSize(2); // Set text size
  51.     tft.print("Widget 1"); // Print widget label
  52. }
  53.  
  54. /****** LOOP FUNCTION *****/
  55. void loop(void)
  56. {
  57.     // Here you can add code to update the dashboard widgets
  58.     // For example, you can read sensor values and update the display accordingly
  59. }
  60.  
  61. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement