├── espruino_esp32.bin ├── partitions_espruino.bin ├── README.md └── QRCode_clock.js /espruino_esp32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atc1441/QRcode_clock/HEAD/espruino_esp32.bin -------------------------------------------------------------------------------- /partitions_espruino.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atc1441/QRcode_clock/HEAD/partitions_espruino.bin -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QRcode_clock 2 | 64x64 RGB LED Matrix QR code clock using ESP32 and Espruino 3 | 4 | This repo is made together with this explanation video:(click on it) 5 | 6 | [![YoutubeVideo](https://img.youtube.com/vi/_Ku3ds-njfU/0.jpg)](https://www.youtube.com/watch?v=_Ku3ds-njfU) 7 | 8 | ### You can support my work via PayPal: https://paypal.me/hoverboard1 this keeps projects like this coming. 9 | 10 | you can flash the image with: 11 | python3 esptool.py --chip esp32 --port "COM4" --baud 921600 write_flash -z --flash_mode "dio" --flash_freq "40m" 0x1000 bootloader.bin 0x10000 espruino_esp32.bin 12 | 13 | or the esp flashing GUI 14 | 15 | 16 | Then go to https://www.espruino.com/ide/ to connect to the ESP32 via UART and upload the JS file to it. 17 | -------------------------------------------------------------------------------- /QRCode_clock.js: -------------------------------------------------------------------------------- 1 | var QRversion = 3; 2 | var QRsize = QRversion * 4 + 17; 3 | var P_R1 = D12, 4 | P_G1 = D13, 5 | P_B1 = D21, 6 | 7 | P_R2 = D4, 8 | P_G2 = D27, 9 | P_B2 = D17, 10 | 11 | P_A = D19, 12 | P_B = D23, 13 | P_C = D18, 14 | P_D = D5, 15 | P_E = D15, 16 | P_LAT = D22, 17 | P_CLK = D14, 18 | P_OE = D2, 19 | MaxLed = 256, 20 | X = 64, 21 | Y = 64; 22 | 23 | function initFM6126() { 24 | console.log('<< initFM6126()'); 25 | var C12 = [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 26 | var C13 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]; 27 | digitalWrite([P_OE, P_LAT, P_CLK], 0b100); 28 | // Send Data to control register 11 29 | for (var l = 0; l < MaxLed; l++) { 30 | y = l % 16; 31 | if (C12[y]) { 32 | digitalWrite([P_R1, P_G1, P_B1, P_R2, P_B2, P_G2], 0b111111); 33 | } else { 34 | digitalWrite([P_R1, P_G1, P_B1, P_R2, P_B2, P_G2], 0); 35 | } 36 | digitalWrite(P_LAT, (l > MaxLed - 12) ? 1 : 0); 37 | digitalWrite(P_CLK, 1); 38 | digitalWrite(P_CLK, 0); 39 | } 40 | digitalWrite(P_LAT, 0); 41 | digitalWrite(P_CLK, 0); 42 | // Send Data to control register 12 43 | for (l = 0; l < MaxLed; l++) { 44 | y = l % 16; 45 | if (C13[y]) { 46 | digitalWrite([P_R1, P_G1, P_B1, P_R2, P_B2, P_G2], 0b111111); 47 | } else { 48 | digitalWrite([P_R1, P_G1, P_B1, P_R2, P_B2, P_G2], 0); 49 | } 50 | digitalWrite(P_LAT, (l > MaxLed - 13) ? 1 : 0); 51 | digitalWrite(P_CLK, 1); 52 | digitalWrite(P_CLK, 0); 53 | } 54 | digitalWrite(P_LAT, 0); 55 | digitalWrite(P_CLK, 0); 56 | console.log('>> initFM6126()'); 57 | } 58 | 59 | 60 | 61 | options = { 62 | "double_buffer":true, 63 | "r1":P_R1,"g1":P_G1,"b1":P_B1, 64 | "r2":P_R2,"g2":P_G2,"b2":P_B2, 65 | "a":P_A,"b":P_B,"c":P_C, "d":P_D,"e":P_E, 66 | "lat":P_LAT,"oe":P_OE,"clk":P_CLK 67 | }; 68 | 69 | console.log(ESP32.getState()); 70 | initFM6126(); 71 | 72 | var g = i2s_matrix.connect(64,64,16,options); 73 | g.flip = () => { i2s_matrix.flip();}; 74 | g.setBrightness = (b) => { i2s_matrix.setBrightness(b);}; 75 | g.setBrightness(10); 76 | g.clear().setFont("6x8",1); 77 | QRoutput = Graphics.createArrayBuffer(QRsize,QRsize,1,{msb:true}); 78 | 79 | setInterval(function(){ 80 | 81 | var t = new Date(); // get the current date and time 82 | var time = t.getHours()+":"+("0"+t.getMinutes()).substr(-2); 83 | var seconds = ("0"+t.getSeconds()).substr(-2); 84 | var date = t.toString().replace(/\d\d:.*/,""); 85 | var QRinput = time + ":" + seconds + " " + date; 86 | console.log(QRinput); 87 | //QRinput = "https://atcnetz.de"; 88 | qr_code.generate(QRinput,QRoutput.buffer,QRversion,3); 89 | g.drawImage(QRoutput.asImage("string"),3,3,{scale:2}); 90 | 91 | },1000); --------------------------------------------------------------------------------