Ja, som det kan ses af nedenstående, så skriver jeg nogle gange på Engelsk.
Teksten til højre for // er en kort beskrivelse af hvad hver linje gør.
/* * CharMap on 4X20 Serial LCD Display. * * Clearing the Display and setting the brightness level. * CharMap from 0x01 to 0xFF in HEX */ void setup() // Run once, when the sketch starts { Serial.begin(9600); // Setting communication up at 9600 bps on TX pin at Arduino Uno Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display delay(10); // Delay for clearing the Display Serial.write(0x7C); // Special Command Serial.write(157); // Backlight brightness level (128 = Off, 140 = 40%, 150 = 73%, 157 = Fully On) delay(10); // Delay for changing Backlight brightness } void loop() // Run over and over again { Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("00h"); // Pretext for line 1 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 // Serial.write(0x00); // Arduino compiler says "call of overloaded 'write(int)' is ambiguous" Serial.write(0xFE); // Special Command Extended Serial.write(0x14); // Move cursor right one Serial.write(0x01); // Screen 1 Row 1 Column 6 Serial.write(0x02); // Screen 1 Row 1 Column 7 Serial.write(0x03); // Screen 1 Row 1 Column 8 Serial.write(0x04); // Screen 1 Row 1 Column 9 Serial.write(0x05); // Screen 1 Row 1 Column 10 Serial.write(0x06); // Screen 1 Row 1 Column 11 Serial.write(0x07); // Screen 1 Row 1 Column 12 Serial.write(0x08); // Screen 1 Row 1 Column 13 Serial.write(0x09); // Screen 1 Row 1 Column 14 Serial.write(0x0A); // Screen 1 Row 1 Column 15 Serial.write(0x0B); // Screen 1 Row 1 Column 16 Serial.write(0x0C); // Screen 1 Row 1 Column 17 Serial.write(0x0D); // Screen 1 Row 1 Column 18 Serial.write(0x0E); // Screen 1 Row 1 Column 19 Serial.write(0x0F); // Screen 1 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x40); // Move to Row 2 Column 1 Serial.print("10h"); // Pretext for line 2 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.write(0x10); // Screen 1 Row 2 Column 5 Serial.write(0x11); // Screen 1 Row 2 Column 6 Serial.write(0x12); // Screen 1 Row 2 Column 7 Serial.write(0x13); // Screen 1 Row 2 Column 8 Serial.write(0x14); // Screen 1 Row 2 Column 9 Serial.write(0x15); // Screen 1 Row 2 Column 10 Serial.write(0x16); // Screen 1 Row 2 Column 11 Serial.write(0x17); // Screen 1 Row 2 Column 12 Serial.write(0x18); // Screen 1 Row 2 Column 13 Serial.write(0x19); // Screen 1 Row 2 Column 14 Serial.write(0x1A); // Screen 1 Row 2 Column 15 Serial.write(0x1B); // Screen 1 Row 2 Column 16 Serial.write(0x1C); // Screen 1 Row 2 Column 17 Serial.write(0x1D); // Screen 1 Row 2 Column 18 Serial.write(0x1E); // Screen 1 Row 2 Column 19 Serial.write(0x1F); // Screen 1 Row 2 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x14); // Move to Row 3 Column 1 Serial.print("20h"); // Pretext for line 3 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x18); // Move to Row 3 Column 5 Serial.write(0x20); // Screen 1 Row 3 Column 5 Serial.write(0x21); // Screen 1 Row 3 Column 6 Serial.write(0x22); // Screen 1 Row 3 Column 7 Serial.write(0x23); // Screen 1 Row 3 Column 8 Serial.write(0x24); // Screen 1 Row 3 Column 9 Serial.write(0x25); // Screen 1 Row 3 Column 10 Serial.write(0x26); // Screen 1 Row 3 Column 11 Serial.write(0x27); // Screen 1 Row 3 Column 12 Serial.write(0x28); // Screen 1 Row 3 Column 13 Serial.write(0x29); // Screen 1 Row 3 Column 14 Serial.write(0x2A); // Screen 1 Row 3 Column 15 Serial.write(0x2B); // Screen 1 Row 3 Column 16 Serial.write(0x2C); // Screen 1 Row 3 Column 17 Serial.write(0x2D); // Screen 1 Row 3 Column 18 Serial.write(0x2E); // Screen 1 Row 3 Column 19 Serial.write(0x2F); // Screen 1 Row 3 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x58); // Move to Row 4 Column 5 Serial.print("+123456789ABCDEF"); // Text for line 4 delay(10000); // Time for Display read out Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("30h"); // Pretext for line 5 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 Serial.write(0x30); // Screen 2 Row 1 Column 5 Serial.write(0x31); // Screen 2 Row 1 Column 6 Serial.write(0x32); // Screen 2 Row 1 Column 7 Serial.write(0x33); // Screen 2 Row 1 Column 8 Serial.write(0x34); // Screen 2 Row 1 Column 9 Serial.write(0x35); // Screen 2 Row 1 Column 10 Serial.write(0x36); // Screen 2 Row 1 Column 11 Serial.write(0x37); // Screen 2 Row 1 Column 12 Serial.write(0x38); // Screen 2 Row 1 Column 13 Serial.write(0x39); // Screen 2 Row 1 Column 14 Serial.write(0x3A); // Screen 2 Row 1 Column 15 Serial.write(0x3B); // Screen 2 Row 1 Column 16 Serial.write(0x3C); // Screen 2 Row 1 Column 17 Serial.write(0x3D); // Screen 2 Row 1 Column 18 Serial.write(0x3E); // Screen 2 Row 1 Column 19 Serial.write(0x3F); // Screen 2 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x40); // Move to Row 2 Column 1 Serial.print("40h"); // Pretext for line 6 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.write(0x40); // Screen 2 Row 2 Column 5 Serial.write(0x41); // Screen 2 Row 2 Column 6 Serial.write(0x42); // Screen 2 Row 2 Column 7 Serial.write(0x43); // Screen 2 Row 2 Column 8 Serial.write(0x44); // Screen 2 Row 2 Column 9 Serial.write(0x45); // Screen 2 Row 2 Column 10 Serial.write(0x46); // Screen 2 Row 2 Column 11 Serial.write(0x47); // Screen 2 Row 2 Column 12 Serial.write(0x48); // Screen 2 Row 2 Column 13 Serial.write(0x49); // Screen 2 Row 2 Column 14 Serial.write(0x4A); // Screen 2 Row 2 Column 15 Serial.write(0x4B); // Screen 2 Row 2 Column 16 Serial.write(0x4C); // Screen 2 Row 2 Column 17 Serial.write(0x4D); // Screen 2 Row 2 Column 18 Serial.write(0x4E); // Screen 2 Row 2 Column 19 Serial.write(0x4F); // Screen 2 Row 2 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x14); // Move to Row 3 Column 1 Serial.print("50h"); // Pretext for line 7 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x18); // Move to Row 3 Column 5 Serial.write(0x50); // Screen 2 Row 3 Column 5 Serial.write(0x51); // Screen 2 Row 3 Column 6 Serial.write(0x52); // Screen 2 Row 3 Column 7 Serial.write(0x53); // Screen 2 Row 3 Column 8 Serial.write(0x54); // Screen 2 Row 3 Column 9 Serial.write(0x55); // Screen 2 Row 3 Column 10 Serial.write(0x56); // Screen 2 Row 3 Column 11 Serial.write(0x57); // Screen 2 Row 3 Column 12 Serial.write(0x58); // Screen 2 Row 3 Column 13 Serial.write(0x59); // Screen 2 Row 3 Column 14 Serial.write(0x5A); // Screen 2 Row 3 Column 15 Serial.write(0x5B); // Screen 2 Row 3 Column 16 Serial.write(0x5C); // Screen 2 Row 3 Column 17 Serial.write(0x5D); // Screen 2 Row 3 Column 18 Serial.write(0x5E); // Screen 2 Row 3 Column 19 Serial.write(0x5F); // Screen 2 Row 3 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x58); // Move to Row 4 Column 8 Serial.print("+123456789ABCDEF"); // Text for line 8 delay(10000); // Time for Display read out Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("60h"); // Pretext for line 9 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 Serial.write(0x60); // Screen 3 Row 1 Column 5 Serial.write(0x61); // Screen 3 Row 1 Column 6 Serial.write(0x62); // Screen 3 Row 1 Column 7 Serial.write(0x63); // Screen 3 Row 1 Column 8 Serial.write(0x64); // Screen 3 Row 1 Column 9 Serial.write(0x65); // Screen 3 Row 1 Column 10 Serial.write(0x66); // Screen 3 Row 1 Column 11 Serial.write(0x67); // Screen 3 Row 1 Column 12 Serial.write(0x68); // Screen 3 Row 1 Column 13 Serial.write(0x69); // Screen 3 Row 1 Column 14 Serial.write(0x6A); // Screen 3 Row 1 Column 15 Serial.write(0x6B); // Screen 3 Row 1 Column 16 Serial.write(0x6C); // Screen 3 Row 1 Column 17 Serial.write(0x6D); // Screen 3 Row 1 Column 18 Serial.write(0x6E); // Screen 3 Row 1 Column 19 Serial.write(0x6F); // Screen 3 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x40); // Move to Row 2 Column 1 Serial.print("70h"); // Pretext for line 10 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.write(0x70); // Screen 3 Row 2 Column 5 Serial.write(0x71); // Screen 3 Row 2 Column 6 Serial.write(0x72); // Screen 3 Row 2 Column 7 Serial.write(0x73); // Screen 3 Row 2 Column 8 Serial.write(0x74); // Screen 3 Row 2 Column 9 Serial.write(0x75); // Screen 3 Row 2 Column 10 Serial.write(0x76); // Screen 3 Row 2 Column 11 Serial.write(0x77); // Screen 3 Row 2 Column 12 Serial.write(0x78); // Screen 3 Row 2 Column 13 Serial.write(0x79); // Screen 3 Row 2 Column 14 Serial.write(0x7A); // Screen 3 Row 2 Column 15 Serial.write(0x7B); // Screen 3 Row 2 Column 16 // Serial.write(0x7C); // Screen 3 Row 2 Column 17 // Special Command so no read out from this hex code Serial.write(0xFE); // Special Command Extended Serial.write(0x14); // Move cursor right one Serial.write(0x7D); // Screen 3 Row 2 Column 18 Serial.write(0x7E); // Screen 3 Row 2 Column 19 Serial.write(0x7F); // Screen 3 Row 2 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x14); // Move to Row 3 Column 1 Serial.print("80h"); // Pretext for line 11 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x18); // Move to Row 3 Column 5 Serial.write(0x80); // Screen 3 Row 3 Column 5 Serial.write(0x81); // Screen 3 Row 3 Column 6 Serial.write(0x82); // Screen 3 Row 3 Column 7 Serial.write(0x83); // Screen 3 Row 3 Column 8 Serial.write(0x84); // Screen 3 Row 3 Column 9 Serial.write(0x85); // Screen 3 Row 3 Column 10 Serial.write(0x86); // Screen 3 Row 3 Column 11 Serial.write(0x87); // Screen 3 Row 3 Column 12 Serial.write(0x88); // Screen 3 Row 3 Column 13 Serial.write(0x89); // Screen 3 Row 3 Column 14 Serial.write(0x8A); // Screen 3 Row 3 Column 15 Serial.write(0x8B); // Screen 3 Row 3 Column 16 Serial.write(0x8C); // Screen 3 Row 3 Column 17 Serial.write(0x8D); // Screen 3 Row 3 Column 18 Serial.write(0x8E); // Screen 3 Row 3 Column 19 Serial.write(0x8F); // Screen 3 Row 3 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x58); // Move to Row 4 Column 5 Serial.print("+123456789ABCDEF"); // Text for line 12 delay(10000); // Time for Display read out Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("90h"); // Pretext for line 13 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 Serial.write(0x90); // Screen 4 Row 1 Column 5 Serial.write(0x91); // Screen 4 Row 1 Column 6 Serial.write(0x92); // Screen 4 Row 1 Column 7 Serial.write(0x93); // Screen 4 Row 1 Column 8 Serial.write(0x94); // Screen 4 Row 1 Column 9 Serial.write(0x95); // Screen 4 Row 1 Column 10 Serial.write(0x96); // Screen 4 Row 1 Column 11 Serial.write(0x97); // Screen 4 Row 1 Column 12 Serial.write(0x98); // Screen 4 Row 1 Column 13 Serial.write(0x99); // Screen 4 Row 1 Column 14 Serial.write(0x9A); // Screen 4 Row 1 Column 15 Serial.write(0x9B); // Screen 4 Row 1 Column 16 Serial.write(0x9C); // Screen 4 Row 1 Column 17 Serial.write(0x9D); // Screen 4 Row 1 Column 18 Serial.write(0x9E); // Screen 4 Row 1 Column 19 Serial.write(0x9F); // Screen 4 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x40); // Move to Row 2 Column 1 Serial.print("A0h"); // Pretext for line 14 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.write(0xA0); // Screen 4 Row 2 Column 5 Serial.write(0xA1); // Screen 4 Row 2 Column 6 Serial.write(0xA2); // Screen 4 Row 2 Column 7 Serial.write(0xA3); // Screen 4 Row 2 Column 8 Serial.write(0xA4); // Screen 4 Row 2 Column 9 Serial.write(0xA5); // Screen 4 Row 2 Column 10 Serial.write(0xA6); // Screen 4 Row 2 Column 11 Serial.write(0xA7); // Screen 4 Row 2 Column 12 Serial.write(0xA8); // Screen 4 Row 2 Column 13 Serial.write(0xA9); // Screen 4 Row 2 Column 14 Serial.write(0xAA); // Screen 4 Row 2 Column 15 Serial.write(0xAB); // Screen 4 Row 2 Column 16 Serial.write(0xAC); // Screen 4 Row 2 Column 17 Serial.write(0xAD); // Screen 4 Row 2 Column 18 Serial.write(0xAE); // Screen 4 Row 2 Column 19 Serial.write(0xAF); // Screen 4 Row 2 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x14); // Move to Row 3 Column 1 Serial.print("B0h"); // Pretext for line 15 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x18); // Move to Row 3 Column 5 Serial.write(0xB1); // Screen 4 Row 3 Column 6 Serial.write(0xB2); // Screen 4 Row 3 Column 7 Serial.write(0xB3); // Screen 4 Row 3 Column 8 Serial.write(0xB4); // Screen 4 Row 3 Column 9 Serial.write(0xB5); // Screen 4 Row 3 Column 10 Serial.write(0xB6); // Screen 4 Row 3 Column 11 Serial.write(0xB7); // Screen 4 Row 3 Column 12 Serial.write(0xB8); // Screen 4 Row 3 Column 13 Serial.write(0xB9); // Screen 4 Row 3 Column 14 Serial.write(0xBA); // Screen 4 Row 3 Column 15 Serial.write(0xBB); // Screen 4 Row 3 Column 16 Serial.write(0xBC); // Screen 4 Row 3 Column 17 Serial.write(0xBD); // Screen 4 Row 3 Column 18 Serial.write(0xBE); // Screen 4 Row 3 Column 19 Serial.write(0xBF); // Screen 4 Row 3 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x58); // Move to Row 4 Column 5 Serial.print("+123456789ABCDEF"); // Text for line 16 delay(10000); // Time for Display read out Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("C0h"); // Pretext for line 17 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 Serial.write(0xC0); // Screen 5 Row 1 Column 5 Serial.write(0xC1); // Screen 5 Row 1 Column 6 Serial.write(0xC2); // Screen 5 Row 1 Column 7 Serial.write(0xC3); // Screen 5 Row 1 Column 8 Serial.write(0xC4); // Screen 5 Row 1 Column 9 Serial.write(0xC5); // Screen 5 Row 1 Column 10 Serial.write(0xC6); // Screen 5 Row 1 Column 11 Serial.write(0xC7); // Screen 5 Row 1 Column 12 Serial.write(0xC8); // Screen 5 Row 1 Column 13 Serial.write(0xC9); // Screen 5 Row 1 Column 14 Serial.write(0xCA); // Screen 5 Row 1 Column 15 Serial.write(0xCB); // Screen 5 Row 1 Column 16 Serial.write(0xCC); // Screen 5 Row 1 Column 17 Serial.write(0xCD); // Screen 5 Row 1 Column 18 Serial.write(0xCE); // Screen 5 Row 1 Column 19 Serial.write(0xCF); // Screen 5 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x40); // Move to Row 2 Column 1 Serial.print("D0h"); // Pretext for line 18 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.write(0xD0); // Screen 5 Row 2 Column 5 Serial.write(0xD1); // Screen 5 Row 2 Column 6 Serial.write(0xD2); // Screen 5 Row 2 Column 7 Serial.write(0xD3); // Screen 5 Row 2 Column 8 Serial.write(0xD4); // Screen 5 Row 2 Column 9 Serial.write(0xD5); // Screen 5 Row 2 Column 10 Serial.write(0xD6); // Screen 5 Row 2 Column 11 Serial.write(0xD7); // Screen 5 Row 2 Column 12 Serial.write(0xD8); // Screen 5 Row 2 Column 13 Serial.write(0xD9); // Screen 5 Row 2 Column 14 Serial.write(0xDA); // Screen 5 Row 2 Column 15 Serial.write(0xDB); // Screen 5 Row 2 Column 16 Serial.write(0xDC); // Screen 5 Row 2 Column 17 Serial.write(0xDD); // Screen 5 Row 2 Column 18 Serial.write(0xDE); // Screen 5 Row 2 Column 19 Serial.write(0xDF); // Screen 5 Row 2 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x14); // Move to Row 3 Column 1 Serial.print("E0h"); // Pretext for line 19 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x18); // Move to Row 3 Column 5 Serial.write(0xE0); // Screen 5 Row 3 Column 5 Serial.write(0xE1); // Screen 5 Row 3 Column 6 Serial.write(0xE2); // Screen 5 Row 3 Column 7 Serial.write(0xE3); // Screen 5 Row 3 Column 8 Serial.write(0xE4); // Screen 5 Row 3 Column 9 Serial.write(0xE5); // Screen 5 Row 3 Column 10 Serial.write(0xE6); // Screen 5 Row 3 Column 11 Serial.write(0xE7); // Screen 5 Row 3 Column 12 Serial.write(0xE8); // Screen 5 Row 3 Column 13 Serial.write(0xE9); // Screen 5 Row 3 Column 14 Serial.write(0xEA); // Screen 5 Row 3 Column 15 Serial.write(0xEB); // Screen 5 Row 3 Column 16 Serial.write(0xEC); // Screen 5 Row 3 Column 17 Serial.write(0xED); // Screen 5 Row 3 Column 18 Serial.write(0xEE); // Screen 5 Row 3 Column 19 Serial.write(0xEF); // Screen 5 Row 3 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x58); // Move to Row 4 Column 5 Serial.print("+123456789ABCDEF"); // Text for line 20 delay(10000); // Time for Display read out Serial.write(0xFE); // Special Command Extended Serial.write(0x01); // Clear Display Serial.print("F0h"); // Pretext for line 21 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x04); // Move to Row 1 Column 5 Serial.write(0xF0); // Screen 6 Row 1 Column 5 Serial.write(0xF1); // Screen 6 Row 1 Column 6 Serial.write(0xF2); // Screen 6 Row 1 Column 7 Serial.write(0xF3); // Screen 6 Row 1 Column 8 Serial.write(0xF4); // Screen 6 Row 1 Column 9 Serial.write(0xF5); // Screen 6 Row 1 Column 10 Serial.write(0xF6); // Screen 6 Row 1 Column 11 Serial.write(0xF7); // Screen 6 Row 1 Column 12 Serial.write(0xF8); // Screen 6 Row 1 Column 13 Serial.write(0xF9); // Screen 6 Row 1 Column 14 Serial.write(0xFA); // Screen 6 Row 1 Column 15 Serial.write(0xFB); // Screen 6 Row 1 Column 16 Serial.write(0xFC); // Screen 6 Row 1 Column 17 Serial.write(0xFD); // Screen 6 Row 1 Column 18 // Serial.write(0xFE); // Screen 6 Row 1 Column 19 // Special Command Extended so no read out from this hex code Serial.write(0xFE); // Special Command Extended Serial.write(0x14); // Move cursor right one Serial.write(0xFF); // Screen 6 Row 1 Column 20 Serial.write(0xFE); // Special Command Extended Serial.write(0x80+0x44); // Move to Row 2 Column 5 Serial.print("+123456789ABCDEF"); // Text for line 22 delay(10000); // Time for Display read out }
Når det vises på LCDen skal det gerne se ud som på denne side, LINK.