What is the drawback of the code given below? [code] #include <SPI.h> #include <Adafruit_GFX> #include <Adafruit_PCD8544.h> #include "images.h"

What is the drawback of the code given below?
Code:
#include <SPI.h>
#include <Adafruit_GFX>
#include <Adafruit_PCD8544.h>
#include "images.h"
Adafruit_PCD8544 display = Adafruit_PCD8544(13, 11, 8, 7, 9);
void setup() {
    display.begin();
    display.setContrast(50);
    display.clearDisplay();
}
void loop() {
    display.clearDisplay();
    display.drawBitmap(0, 0, Face, 84, 48, 1);
    display.display();
    delay(300);
    display.clearDisplay();
}
A. Wrong header file name
B. Wrong display coordinate
C. Wrong target datatype
D. Incorrect parenthesis
 
Answer: A
Explanation:The code misspelled the Adafruit_GFX library by not adding the C header file name extension “.h” at the end of the name. The Adafruit_GFX library is very important as it pairs the Arduino and allows it to talk to TFT displays connected to it.
 

Tìm kiếm

Back
Top