Skip to content

Commit 90b3ec6

Browse files
Tutorial fixes
1 parent 973c576 commit 90b3ec6

File tree

1 file changed

+36
-0
lines changed
  • content/hardware/10.mega/shields/giga-display-shield/tutorials/basic-draw

1 file changed

+36
-0
lines changed

content/hardware/10.mega/shields/giga-display-shield/tutorials/basic-draw/basic-draw.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,42 @@ Now that the drawing is done the `Display.endDraw()` function can be called.
8383

8484
The complete code can be found as an example in the **Arduino_H7_video** library, it is called **ArduinoLogoDrawing**. Now upload the entire sketch and you should see the Arduino logo being drawn on the display.
8585

86+
### Full Sketch
87+
88+
```arduino
89+
#include "Arduino_H7_Video.h"
90+
#include "ArduinoGraphics.h"
91+
92+
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
93+
//Arduino_H7_Video Display(1024, 768, USBCVideo);
94+
95+
void setup() {
96+
Display.begin();
97+
98+
Display.beginDraw();
99+
Display.background(255, 255, 255);
100+
Display.clear();
101+
Display.fill(0x008184);
102+
Display.circle(Display.width()/2, Display.height()/2, 300);
103+
Display.stroke(255, 255, 255);
104+
Display.noFill();
105+
for (int i=0; i<30; i++) {
106+
Display.circle((Display.width()/2)-55+5, Display.height()/2, 110-i);
107+
Display.circle((Display.width()/2)+55-5, Display.height()/2, 110-i);
108+
}
109+
Display.fill(255, 255, 255);
110+
Display.rect((Display.width()/2)-55-16+5, (Display.height()/2)-5, 32, 10);
111+
Display.fill(255, 255, 255);
112+
Display.rect((Display.width()/2)+55-16-5, (Display.height()/2)-5, 32, 10);
113+
Display.fill(255, 255, 255);
114+
Display.rect((Display.width()/2)+55-5-5, (Display.height()/2)-16, 10, 32);
115+
Display.endDraw();
116+
}
117+
118+
void loop() { }
119+
120+
```
121+
86122
## Testing It Out
87123

88124
Now that it is all uploaded your display shield should look like the image below:

0 commit comments

Comments
 (0)