Writing to the Maker Screen

The most basic thing Maker Screen can do is show messages that you write in your code. To do that, you need to:

  • Set up your Maker Screen in the program
  • Create the message you want to send
  • Place that message on the screen

Take a look at the code that will help you do that:

/* Using a Maker Screen, learn to write a message with code. * Be sure that you have the library from Let's Start Coding * to complete this program. www.letsstartcoding.com/libraries */ // include the library code: #include "MakerScreenXVI.h" //Create an object for the MakerScreenXVI library named 'lcd' MakerScreenXVI lcd; void setup() { //Always type the lcd's name followed by .begin() in the void setup() lcd.begin(); //.begin() method 'turns on' a number of settings in the library lcd.print("Hello There!"); //the .print() method sends a message to the lcd. lcd.setCursor(0,1);//set the cursor to the first column (0), second row (1) lcd.print("LetsStartCoding"); } void loop() { //No code needed in the loop! } //Try a different message. What happens when a message is longer than the screen? //Remove one of the quotes (") from the message- what happens? // (c) 2017 Let's Start Coding. License: www.letsstartcoding.com/bsdlicense

Even if you've coded with Maker Board before, you saw some new commands in this code like lcd.print() and lcd.setCursor(). Those commands were invented to simplify working with the screen. 

Near the very top of the code, you included the library by typing #include "MakerScreenXVI.h". That line enables new screen commands (called methods) that you use throughout the code. If you don't include the library, the code doesn't recognize the methods.

When you type the line MakerScreenXVI lcd; you created an object for the MakerScreenXVI library named lcd. You can name that object almost anything that you'd like. 

When you use the commands like .print() and .setCursor(), those methods have to apply to something- they can't exist without an object. That's why you type lcd.print()

You'll learn more about the available methods and what they do in the Screen Methods and Controls lesson.