- the old way, cross-comple command-line programs from PC. or build qt-android-apk with qcreator, please refer to:
https://github.com/liaods/c_enviroment_android Write a Simple Command-Line Program to Control Hardware under Android on pcDuino http://www.pcduino.com/?p=1519 Quick Start Guide on setup QT5 for Android on pcDuino http://www.pcduino.com/?p=1494
- compile you program on pcDuino (native compile)
-
Get the toolchain and pcduino libs from https://github.com/liaods/pcduino-gcc-on-android
-
Open Terminal APK, and run the following commands $ su
- write your code and save it(with busybox vi or other gui tools), for example /data/blink_led.c
#include <Arduino.h> int led_pin = 18; // pcduino TX LED
void setup() { pinMode(led_pin, OUTPUT); }
void loop() { digitalWrite(led_pin, HIGH); delay(1000); digitalWrite(led_pin, LOW); delay(1000); }
- compile and run before this step, run env.sh to setting up the enviroment
target is blink_led run it: #./blink_led Press Ctrl + C to stop it!