External modules

This section will show you how to connect and use different types of external hardware modules with CORE2. CORE2 has UART, I2C, SPI, CAN, ADC and external interrupt channels to connect and efficiently use a lot of market available external modules. The following examples will help you connect not only the modules made by Husarion but also the third-party drivers, sensors etc.

1. Sharp distance sensor

Bellow schematic and source code shows you how to connect Sharp GP2Y0A41SK0F infrared proximity sensor to CORE2. Sample source code shows how to output readings from sensor directly to the user interface of your device at .

uint16_t v_int;



while (true) {
    v_int = hSens1.pin1.analogReadRaw();
    platform.ui.label("l1").setText("Sensor raw output = %d\r\n", v_int);

2. MPU-9250 inertial mesurement unit

MPU-9250 is a nine-axis (gyro, accelerometer, compass) inertial measuerement unit useful in a large variety of applications, e.g. drones. Below image will help you start using this awesome sensor!

The example firmware using MPU-9250 is available as a template from Husarion Cloud.