import mcujavasource.mcu.*; import mcujavasource.mcu.external.lcd.Nokia3310Lcd; /** Tutorial 10: Nokia 3310 LCD. * Shows "chess board" on LCD, cell size 4x4 pixels. */ public class Main extends Microcontroller { public static final String MESSAGE = "Hello, LCD!"; private Nokia3310Lcd lcd; private Port lcdControlPort = getHardware().getPort("B"); private Pin csPin = lcdControlPort.getPin(1); private Pin dcPin = lcdControlPort.getPin(0); private Pin resetPin = lcdControlPort.getPin(2); public void init() { getHardware().setAllPortsDirection(Pin.IN); getHardware().setAllPortsPullUp(true); lcd = new Nokia3310Lcd(csPin, dcPin, resetPin); } public void start() { lcd.init(); lcd.setPosition(0, 0); for(int row = 0; row < 6; row ++) { for(int col = 0; col < 84; col++) { byte data = 0x0F; if((col & 4)==0) data = (byte)0xF0; lcd.sendData(data); } } getHardware().setInterruptsEnabled(true); } }