website statistics

helloworldΒΆ

../../../_images/main6.png

The minimal program.

The loop() function draws ‘Hello world’ on a green background. The code

  • sets the clear color to green, using an RGB hex triplet
  • clears the screen
  • writes the text centered on the screen. (240, 136) is the center of the screen. It uses font 31, the largest
  • calls GD.swap() to make the screen visible
#include <EEPROM.h> //' A{
#include <SPI.h>
#include <GD2.h>

void setup()
{
  GD.begin();
}

void loop()
{
  GD.ClearColorRGB(0x103000);
  GD.Clear();
  GD.cmd_text(240, 136, 31, OPT_CENTER, "Hello world");
  GD.swap();
} //' }A