| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

RaphaelMeyer_Lab5

Page history last edited by Raphaelm 6 years, 12 months ago

a. With the standard font, what is the longest message you can write across one line of the display? How many lines can you write?

I counted 15 chars (but I might just be bad at counting...)

 

a. Upload a photo of your personal logo, shown on your LCD screen, to your Lab 5 page.

TODO: LINK

 

a. Include the code that you had to insert to do this in your lab writeup. 

You just need to add

[dataFile.write("Shaun the Sheep");]

b. Explain what would you do differently (or show us your code!) to insert the same text string, but at the beginning of the file (without over-writing the current contents).

[ code :

File dataFile;

dataFile.write("Shaun the Sheep");

Serial.println("Shaun the Sheep");

File sdFile = SD.open("datalog.txt");

if(!SD.begin(chipSelect)){

return;

sdFile.close();

}

 

if(sdFile) {

while(sdFile.available()) {

char read = sdFile.read();

dataFile.print(read);

Serial.print(read);

}

}

 

sdFile = dataFile;

sdFile.flush(); //Just to be sure that it saves

sdFile.close();

]

 

a. Post your code.

It's not much, you add in all of the lcd initilizers from graphicsExample to the SD_Example_Code file, and change Serial. to lcd.

 

a. Tell us what you had to change to make this work

I did not have to change much, I just imported the SD library, initialized a File, and used the read/write commands for the File instead of the EEPROM ones.

 

Comments (0)

You don't have permission to comment on this page.