Week12:Output devices

Previous weekAssciment listNext week

Preparation: Test the lcd module in arduino

/*
 This example code is in the public domain.
 http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}
void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
}

input

Using Attiny44 to drive LCD with Hello.LCD.44.c

input
input

Use I2C protocol to control the LCD

the sample code as fallows:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>
    
LiquidCrystal_I2C lcd(0x27,16,2);

void setup(){
lcd.init();
lcd.backlight();
lcdprint("Hello World");
}

void loop(){
}

input

About meassignmentAbout Final Project
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.