Example Code for UNIHIKER K10 - Analog input/output

Explore UNIHIKER K10 analog input/output code.

Hardware Preparation

Note: The multi-functional expansion board requires separate power supply when IN use. It can be powered by installing an 18650 battery or from the USB IN of the expansion board, and the PWR power supply switch needs to be turned on.

Software Preparation

If Using Mind+

  • Mind+ Download
    • Mind+ User Extension: https://github.com/YeezB/ext-UnihikerExpansion

If Using Arduino IDE

Hardware Connection

DFR1216 connection

Use UNIHIKER K10 & Mind+

Use UNIHIKER K10 & Arduino IDE

#include "unihiker_k10.h"
#include "DFRobot_UnihikerExpansion.h"
DFRobot_UnihikerExpansion_I2C eunihiker(&Wire);
UNIHIKER_K10 k10;
uint8_t screen_dir=2;

void setup() {
  k10.begin();
  while(!eunihiker.begin()){
    Serial.println("NO Deivces !");
    delay(1000);
  } Serial.println("Device connected !");
  eunihiker.setMode(eC0, eADC);
  k10.initScreen(screen_dir);
  k10.creatCanvas();
}
void loop() {
  k10.canvas->canvasText((eunihiker.getADCValue(eC0)), 1, 0x0000FF);
  k10.canvas->updateCanvas();
}

UNIHIKER K10 Result

Was this article helpful?

TOP