UNIHIKERMind+General

Unihiker and C/C++

userHead Johan_Ha 2026-01-20 17:32:15 24 Views0 Replies

The Unihiker M10 is supposed to be programmed with Python, right. I happen to be fluent in C/C++, which traditionally produces native code for any target. I'm 62 and I am not very keen on learning new programming languages, especially ones, that need interpreters for the programs to work.

So, I'm checking out different methods for programming the Unihiker using C/C++. I've tested two approaches, neither have worked yet, not fully.

 

1, have the compiler installed on the unihiker

 

I had Copilot (an AI bot) to help me install everything. I used Visual Studio Code on my Windows laptop. And an SSH connection via USB between VS Code and the Unihiker. So, what I had was a Linux terminal window on my laptop, and in that window I did everything, installing needed software on the Unihiker, writing code with nano (a text editor in Linux), compiling etc. Simple text out programs put the text into the same window (namely my laptop, not the Unihiker screen). I asked Copilot for code to create graphic output and touchscreen input on the Unihiker. That worked, too. But there were a lot of problems. One was the SSH contact dropping all the time. When sessions broke and I had new logins, a lot of settings got lost. And the internal system of the Unihiker kept pushing text into the screen of the Unihiker, corrupting the graphic output I wanted.

 

2, doing the programming on my laptop

 

I needed a setup, where I wasn't dependent on the SSH connection. The idea was to use a cross-compiler on the laptop, i.e. writing the code on the laptop (not the Unihiker via a terminal on the laptop), compiling and building executables, not for the laptop, but the Unihiker, then transfer the produced binaries over to the Unihiker. The transfer would be one single step depending on the SSH. This worked, too, but I had loads of problems making the cross-compiler settings work. First of all, I had to install a Linux on my Windows laptop. Inside that, I had to create an exact copy of the setup in the Unihiker. Then, everything that had to do with compiling and building binaries, had to point to the Unihiker, not the laptop. This failed. I did get some simple program to work, but the problems were too many. No matter what I did, there were always some small details that assumed I was compiling for the laptop, not for the Unihiker. I felt that each new step I would do, each new library I'd need, would immediately lead to the same errors: wrong target.

 

So I'm right now working on the 1st option again. I have a better USB cable between my laptop and the Unihiker. And I'm running the compiler and everything on the Unihiker. The laptop is just a terminal. I'm convinced I will have a programming environment, which can produce beautiful applications on the Unihiker, running native code, native binaries, on the Unihiker. With full graphics, touchscreen, all sensors and all GPIO pins. And I bet the apps will be faster than the Python equivalents. No bad words about Python, it's just not one of my languages.

Why did I tag Mind+ to this post? I tried Mind+, because it is supposed to support C/C++ and Python, besides block code. But not for Unihiker. Apparently it compiles C/C++ only for Arduinos and other architectures, but not for Unihiker.