Luc Paquin
Published © CC BY

Project #30 - UNIHIKER - RTC - Mk18

Project #30 - UNIHIKER - RTC - Mk18

BeginnerFull instructions provided1 hour32
Project #30 - UNIHIKER - RTC - Mk18

Things used in this project

Hardware components

DFRobot UNIHIKER K10
×1
Gravity: I2C SD2405 RTC Module
DFRobot Gravity: I2C SD2405 RTC Module
×1
DFRobot Lithium Ion Battery - 1000mAh
×1
SparkFun Switch
×1
DFRobot USB 3.1 Cable A to C
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Fritzing

Code

DL2508Mk01p

Arduino
/****** Don Luc Electronics © ******
Software Version Information
Project #30 - UNIHIKER - RTC - Mk18
DL2508Mk01p.mp
DL2508Mk01
1 x UNIHIKER K10
1 x Gravity I2C SD2405 RTC module
1 x Lithium Ion Battery - 1000mAh
1 x Switch
1 x USB 3.1 Cable A to C
*/

// Include the Library Code
// Unihiker K10
#include "unihiker_k10.h"
// Gravity I2C SD2405 RTC module
DFRobot_DS0469 ds0469;
// Create an object
UNIHIKER_K10  k10;
// Screen
uint8_t screen_dir=2;

// Main program start
void setup() {
	
  // Begin
  k10.begin();
  // Init Screen
  k10.initScreen(screen_dir);
  // Canver
  k10.creatCanvas();
  // Gravity I2C SD2405 RTC module
  ds0469.begin();
  // Image
  k10.canvas->canvasDrawBitmap(0,0,240,320,image_data1);

}
// Loop
void loop() {
	
  // Gravity I2C SD2405 RTC module
  k10.canvas->canvasText("Real Time Clock", 6, 0xFF0000);
  // RTC
  // Year
  k10.canvas->canvasText(ds0469.getTime(ds0469.YEAR), 7, 0x0000FF);
  // Month
  k10.canvas->canvasText(ds0469.getTime(ds0469.MONTH), 8, 0x0000FF);
  // Date
  k10.canvas->canvasText(ds0469.getTime(ds0469.DATE), 9, 0x0000FF);
  // Hour
  k10.canvas->canvasText(ds0469.getTime(ds0469.HOUR), 10, 0x0000FF);
  // Minute
  k10.canvas->canvasText(ds0469.getTime(ds0469.MINUTE), 11, 0x0000FF);
  // Seconds
  k10.canvas->canvasText(ds0469.getTime(ds0469.SECONDS), 12, 0x0000FF);
  // Update Canvas
  k10.canvas->updateCanvas();

}

Credits

Luc Paquin
44 projects • 4 followers
Teacher, Instructor, E-Mentor, R&D and Consulting -Programming Language -Microcontrollers -IoT -Robotics -Machine Learning -AI -Sensors

Comments