

I’ll also remove SB16 and SB18, as they only provide pin-to-pin compatibility with Arduino but they block the usage of two pins. According to the documentation, the onboard MCU can be powered via a 3V3 pin if the solder bridges SB9 and SB14 are removed. This includes the power LED and the ST-LINK interface. Since I’m aiming for a battery-powered application, I need to disconnect everything extra that consumes electricity from the battery. It contains its own charge/discharge protection circuit, which is always nice to have. They are readily available on eBay and in most electronics and hobby stores. Let’s use the simplest charger possible – a module based on a TC4056A chip. Unprotected lithium cells can cause fire or explosion if they are short-circuited. If you do use an 18650, make sure to use one with a built-in protection circuit. Any battery would be suitable, for example, an old phone battery or an 18650 cell. I’m going to use a 1000 mAh battery from an action camera. The sensor and the screen can both be powered by either 5V (Arduino) or 3.3V (STM32).Ī single-cell LiPo or Li-ion battery is a good solution to power the device.

We’ll use a GY-65 module, though a BMP180 ( GY-68) would do the job just as well. We’ll use the same sensor and screen we used in Part 1:Ī Bosch BMP085 air pressure sensor.
#CLION ARDUINO PLUS#
Plus lots of other stuff that we won’t need for this project.
#CLION ARDUINO SERIAL#
On-board ST-LINK/V2 debugger/programmer, which allows us to flash our code to the MCU and debug it right on the chip.Ī hardware serial port (UART) connected to a USB-UART bridge, which can be used for diagnostics output. This is what is included in the board and its MCU:Īnalog-digital convertor (ADC) to monitor the battery charge.Īn on-chip RTC with a 32.768 kHz quartz oscillator. I am going to use an ST Nucleo-L432KC board based on the STM32L432 MCU, just because I have one lying around, but there are many different boards that fit the requirements, and the project can be built around any STM32L4-series microcontroller(MCU). We’ll need a real-time clock (RTC), a serial peripheral interface (SPI) interface for the screen, an I2C interface for the weather sensor, and at least 16 KB of RAM, and 64 KB of ROM, all preferably with the lowest possible power consumption.
#CLION ARDUINO WINDOWS#
With this setup you'll be able to develop on Windows and as well on Linux and OSX. Read the ManualĬMake is a bit tricky to get at first, but it's a really powerful tool, and cross platform. If you start having more than one file in your src folder, you'll need to add them to the src CMake file. Copy its contents to the lib folder of your project along with the CMakeLists.txt file Write your sourcecode You should have somewhere on your drive the Arduino core library, on Windows I've found it in C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino. This will populate the folder YourProject with a src and lib folder.

Once you get the gist (pun) of it, you should be fine ! Get Platform.IOįollow the instructions here Create a new project # Create new folder YourProject Here's my quick guide to set up CLion to work with the Arduino (and others) platforms.
