Skip to content

Commit d373c1c

Browse files
committed
Added comments on example Factory Programming
1 parent 376c4e9 commit d373c1c

File tree

4 files changed

+57
-60
lines changed

4 files changed

+57
-60
lines changed

examples/Inkplate10/Others/Inkplate_Factory_Programming_VCOM/Inkplate_Factory_Programming_VCOM.ino

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void test()
445445
// alive.
446446
cnt++;
447447
}
448-
if (WiFi.status() == WL_CONNECTED)
448+
if (WiFi.status() == WL_CONNECTED) // Check if board is connected to WiFi
449449
{
450450
Serial.println("WiFi is working!");
451451
}
@@ -454,11 +454,11 @@ void test()
454454
Serial.println("Not connected to WiFi network!");
455455
}
456456

457-
Wire.beginTransmission(0x51);
457+
Wire.beginTransmission(0x51); // Send address 0x51 on I2C
458458

459459
time_t begined = 0;
460460

461-
if (Wire.endTransmission() == 0)
461+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
462462
{
463463
begined = millis();
464464
display.rtcReset();
@@ -478,9 +478,9 @@ void test()
478478
Serial.println("SD card slot is not working");
479479
}
480480

481-
Wire.beginTransmission(0x20);
481+
Wire.beginTransmission(0x20); // Send address 0x20 on I2C
482482

483-
if (Wire.endTransmission() == 0)
483+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
484484
{
485485
Serial.println("MCP /1 found");
486486
}
@@ -489,9 +489,9 @@ void test()
489489
Serial.println("MCP /1 not found");
490490
}
491491

492-
Wire.beginTransmission(0x22);
492+
Wire.beginTransmission(0x22); // Send address 0x22 on I2C
493493

494-
if (Wire.endTransmission() == 0)
494+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
495495
{
496496
Serial.println("MCP /2 found");
497497
}
@@ -502,13 +502,13 @@ void test()
502502

503503
display.einkOn();
504504

505+
Wire.beginTransmission(0x48); // Send address 0x48 on I2C
506+
505507
delay(200);
506-
507-
Wire.beginTransmission(0x48);
508508

509-
if (Wire.endTransmission() == 0)
509+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
510510
{
511-
if (display.readPowerGood())
511+
if (display.readPowerGood()) // Test if power supply for e-ink is OK
512512
{
513513
Serial.println("TPS working!");
514514
}
@@ -522,20 +522,18 @@ void test()
522522
{
523523
Serial.println("TPS not found!");
524524
}
525-
display.digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, WAKEUP, LOW);
526-
display.digitalWriteInternal(MCP23017_INT_ADDR, mcpRegsInt, PWRUP, LOW);
527525

528526
delay(5000);
529527

530-
if (begined != 0)
528+
if (begined != 0) // Check if RTC measures time correctly
531529
{
532-
display.rtcGetRtcData();
530+
display.rtcGetRtcData(); // Get data from RTC
533531

534-
begined = (millis() - begined) / 1000;
532+
begined = (millis() - begined) / 1000; // Get time esp32 has measured
535533

536534
time_t diff = display.rtcGetEpoch() - 1600000000ULL;
537535

538-
if ( abs(begined - diff) < 2)
536+
if ( abs(begined - diff) < 2) // Compare times
539537
{
540538
Serial.println("RTC is working");
541539
}

examples/Inkplate5/Others/Inkplate_Factory_Programming_VCOM/Inkplate_Factory_Programming_VCOM.ino

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void test()
390390
// alive.
391391
cnt++;
392392
}
393-
if (WiFi.status() == WL_CONNECTED)
393+
if (WiFi.status() == WL_CONNECTED) // Check if board is connected to WiFi
394394
{
395395
Serial.println("WiFi is working!");
396396
}
@@ -399,11 +399,11 @@ void test()
399399
Serial.println("Not connected to WiFi network!");
400400
}
401401

402-
Wire.beginTransmission(0x51);
402+
Wire.beginTransmission(0x51); // Send address 0x51 on I2C
403403

404404
time_t begined = 0;
405405

406-
if (Wire.endTransmission() == 0)
406+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
407407
{
408408
begined = millis();
409409
display.rtcReset();
@@ -423,9 +423,9 @@ void test()
423423
Serial.println("SD card slot is not working");
424424
}
425425

426-
Wire.beginTransmission(0x20);
426+
Wire.beginTransmission(0x20); // Send address 0x20 on I2C
427427

428-
if (Wire.endTransmission() == 0)
428+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
429429
{
430430
Serial.println("MCP /1 found");
431431
}
@@ -434,9 +434,9 @@ void test()
434434
Serial.println("MCP /1 not found");
435435
}
436436

437-
Wire.beginTransmission(0x22);
437+
Wire.beginTransmission(0x22); // Send address 0x22 on I2C
438438

439-
if (Wire.endTransmission() == 0)
439+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
440440
{
441441
Serial.println("MCP /2 found");
442442
}
@@ -447,13 +447,13 @@ void test()
447447

448448
display.einkOn();
449449

450-
Wire.beginTransmission(0x48);
450+
Wire.beginTransmission(0x48); // Send address 0x48 on I2C
451451

452452
delay(200);
453453

454-
if (Wire.endTransmission() == 0)
454+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
455455
{
456-
if (display.readPowerGood())
456+
if (display.readPowerGood()) // Test if power supply for e-ink is OK
457457
{
458458
Serial.println("TPS working!");
459459
}
@@ -470,15 +470,15 @@ void test()
470470

471471
delay(5000);
472472

473-
if (begined != 0)
473+
if (begined != 0) // Check if RTC measures time correctly
474474
{
475-
display.rtcGetRtcData();
475+
display.rtcGetRtcData(); // Get data from RTC
476476

477-
begined = (millis() - begined) / 1000;
477+
begined = (millis() - begined) / 1000; // Get time esp32 has measured
478478

479479
time_t diff = display.rtcGetEpoch() - 1600000000ULL;
480480

481-
if ( abs(begined - diff) < 2)
481+
if ( abs(begined - diff) < 2) // Compare times
482482
{
483483
Serial.println("RTC is working");
484484
}

examples/Inkplate6/Others/Inkplate_Factory_Programming_VCOM/Inkplate_Factory_Programming_VCOM.ino

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void test()
396396
// alive.
397397
cnt++;
398398
}
399-
if (WiFi.status() == WL_CONNECTED)
399+
if (WiFi.status() == WL_CONNECTED) // Check if board is connected to WiFi
400400
{
401401
Serial.println("WiFi is working!");
402402
}
@@ -405,11 +405,11 @@ void test()
405405
Serial.println("Not connected to WiFi network!");
406406
}
407407

408-
Wire.beginTransmission(0x51);
408+
Wire.beginTransmission(0x51); // Send address 0x51 on I2C
409409

410410
time_t begined = 0;
411411

412-
if (Wire.endTransmission() == 0)
412+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
413413
{
414414
begined = millis();
415415
display.rtcReset();
@@ -429,9 +429,9 @@ void test()
429429
Serial.println("SD card slot is not working");
430430
}
431431

432-
Wire.beginTransmission(0x20);
432+
Wire.beginTransmission(0x20); // Send address 0x20 on I2C
433433

434-
if (Wire.endTransmission() == 0)
434+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
435435
{
436436
Serial.println("MCP /1 found");
437437
}
@@ -440,9 +440,9 @@ void test()
440440
Serial.println("MCP /1 not found");
441441
}
442442

443-
Wire.beginTransmission(0x22);
443+
Wire.beginTransmission(0x22); // Send address 0x22 on I2C
444444

445-
if (Wire.endTransmission() == 0)
445+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
446446
{
447447
Serial.println("MCP /2 found");
448448
}
@@ -453,13 +453,13 @@ void test()
453453

454454
display.einkOn();
455455

456-
Wire.beginTransmission(0x48);
456+
Wire.beginTransmission(0x48); // Send address 0x48 on I2C
457457

458458
delay(200);
459459

460-
if (Wire.endTransmission() == 0)
460+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
461461
{
462-
if (display.readPowerGood())
462+
if (display.readPowerGood()) // Test if power supply for e-ink is OK
463463
{
464464
Serial.println("TPS working!");
465465
}
@@ -476,15 +476,15 @@ void test()
476476

477477
delay(5000);
478478

479-
if (begined != 0)
479+
if (begined != 0) // Check if RTC measures time correctly
480480
{
481-
display.rtcGetRtcData();
481+
display.rtcGetRtcData(); // Get data from RTC
482482

483-
begined = (millis() - begined) / 1000;
483+
begined = (millis() - begined) / 1000; // Get time esp32 has measured
484484

485485
time_t diff = display.rtcGetEpoch() - 1600000000ULL;
486486

487-
if ( abs(begined - diff) < 2)
487+
if ( abs(begined - diff) < 2) // Compare times
488488
{
489489
Serial.println("RTC is working");
490490
}

examples/Inkplate6PLUS/Others/Inkplate_Factory_Programming_VCOM/Inkplate_Factory_Programming_VCOM.ino

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ void test()
403403
// alive.
404404
cnt++;
405405
}
406-
if (WiFi.status() == WL_CONNECTED)
406+
if (WiFi.status() == WL_CONNECTED) // Check if board is connected to WiFi
407407
{
408408
Serial.println("WiFi is working!");
409409
}
@@ -412,11 +412,11 @@ void test()
412412
Serial.println("Not connected to WiFi network!");
413413
}
414414

415-
Wire.beginTransmission(0x51);
415+
Wire.beginTransmission(0x51); // Send address 0x51 on I2C
416416

417417
time_t begined = 0;
418418

419-
if (Wire.endTransmission() == 0)
419+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
420420
{
421421
begined = millis();
422422
display.rtcReset();
@@ -436,9 +436,9 @@ void test()
436436
Serial.println("SD card slot is not working");
437437
}
438438

439-
Wire.beginTransmission(0x20);
439+
Wire.beginTransmission(0x20); // Send address 0x20 on I2C
440440

441-
if (Wire.endTransmission() == 0)
441+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
442442
{
443443
Serial.println("MCP /1 found");
444444
}
@@ -447,9 +447,9 @@ void test()
447447
Serial.println("MCP /1 not found");
448448
}
449449

450-
Wire.beginTransmission(0x22);
450+
Wire.beginTransmission(0x22); // Send address 0x22 on I2C
451451

452-
if (Wire.endTransmission() == 0)
452+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
453453
{
454454
Serial.println("MCP /2 found");
455455
}
@@ -460,14 +460,13 @@ void test()
460460

461461
display.einkOn();
462462

463-
Wire.beginTransmission(0x48);
463+
Wire.beginTransmission(0x48); // Send address 0x48 on I2C
464464

465465
delay(200);
466466

467-
if (Wire.endTransmission() == 0)
467+
if (Wire.endTransmission() == 0) // Check if there was an error in communication
468468
{
469-
470-
if (display.readPowerGood())
469+
if (display.readPowerGood()) // Test if power supply for e-ink is OK
471470
{
472471
Serial.println("TPS working!");
473472
}
@@ -484,15 +483,15 @@ void test()
484483

485484
delay(5000);
486485

487-
if (begined != 0)
486+
if (begined != 0) // Check if RTC measures time correctly
488487
{
489-
display.rtcGetRtcData();
488+
display.rtcGetRtcData(); // Get data from RTC
490489

491-
begined = (millis() - begined) / 1000;
490+
begined = (millis() - begined) / 1000; // Get time esp32 has measured
492491

493492
time_t diff = display.rtcGetEpoch() - 1600000000ULL;
494493

495-
if ( abs(begined - diff) < 2)
494+
if ( abs(begined - diff) < 2) // Compare times
496495
{
497496
Serial.println("RTC is working");
498497
}

0 commit comments

Comments
 (0)