private async void Page_Loaded(object sender, RoutedEventArgs e) { //Stopwatch TK_LCDlcm1602DriverWRC.LCDI2C l = new TK_LCDlcm1602DriverWRC.LCDI2C(0x27, 2, 16); await l.InitAsync(); l.backlight(); l.setCursor(0, 0); l.printstr("ABC"); l.blink(); l.noBlink(); l.scrollDisplayLeft(); l.scrollDisplayRight(); l.cursor(); l.printstr("DEF"); l.setCursor(2, 1); l.printstr("GHI"); l.noCursor(); l.createChar(0, bell); l.createChar(1, note); l.createChar(2, clock); l.createChar(3, heart); l.createChar(4, duck); l.createChar(5, check); l.createChar(6, cross); l.createChar(7, retarrow); l.clear(); l.home(); for (byte i = 0; i <= 7; i++) { l.write(i); } l.noBacklight(); return; //await testIfWorking(); }
private async Task runDemo() { TK_LCDlcm1602DriverWRC.LCDI2C l = new TK_LCDlcm1602DriverWRC.LCDI2C(0x27, 2, 16); await l.InitAsync(); while (true) { l.noBacklight(); await Task.Delay(1000); l.setCursor(0, 0); await Task.Delay(1000); l.backlight(); await Task.Delay(1000); l.printstr("OK!"); await Task.Delay(1000); l.blink(); await Task.Delay(1000); l.noBlink(); await Task.Delay(1000); l.scrollDisplayLeft(); await Task.Delay(1000); l.scrollDisplayRight(); await Task.Delay(1000); l.cursor(); await Task.Delay(1000); l.setCursor(2, 1); await Task.Delay(1000); l.printstr("Windows IoT"); l.noCursor(); await Task.Delay(1000); l.createChar(0, bell); l.createChar(1, note); l.createChar(2, clock); l.createChar(3, heart); l.createChar(4, duck); l.createChar(5, check); l.createChar(6, cross); l.createChar(7, retarrow); await Task.Delay(1000); l.clear(); l.home(); for (byte i = 0; i <= 7; i++) { l.write(i); } await Task.Delay(1000); l.clear(); } }