-
Notifications
You must be signed in to change notification settings - Fork 2
/
1-ShowText.ino
51 lines (40 loc) · 1.18 KB
/
1-ShowText.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Author : Teeraphat Kullanankanjana
Version : 1.0
Date : 18/07/2023
Description : Show simple text to display.
Copyright (C) 2023 Teeraphat Kullanankanjana. All rights reserved.
*/
// Include the Arduino MKR IoT Carrier header file (Library)
#include <Arduino_MKRIoTCarrier.h>
// Create an instance of the MKRIoTCarrier class
MKRIoTCarrier carrier;
// Color definitions
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define ORANGE 0xFC00
#define WHITE 0xFFFF
#define BLACK 0x0000
#define GREEN 0x07E0
#define BLUE 0x001F
#define CYAN 0x07FF
#define RED 0xF800
void setup() {
// Initialize the Arduino MKR IoT Carrier
carrier.begin();
// Initialize the serial communication at 9600 baud rate
Serial.begin(9600);
// Set the background color of the display to white
carrier.display.fillScreen(WHITE);
// Set the text color to red
carrier.display.setTextColor(RED);
// Set the text size to 4 (large)
carrier.display.setTextSize(4);
// Set the cursor position on the display
carrier.display.setCursor(60, 80);
// Display the text "Hello" at the specified position
carrier.display.print("Hello");
}
void loop() {
// Your code goes here
}