![Teguar TP-RC55-08 Quick Installaion Manual Download Page 14](http://html1.mh-extra.com/html/teguar/tp-rc55-08/tp-rc55-08_quick-installaion-manual_1075462014.webp)
Installation Guide TP-RC55-08
www.teguar.com
Page 14
export PATH="/sbin:/system/sbin:/system/bin:/system/xbin"
echo $PATH
# using internal storage
until cat /data/data/com.example.hellojni/files/RedOff.txt > /dev/null; do
# using external storage
# until cat /mnt/sdcard/ib_led/GreenOff > /dev/null; do
# echo "check /mnt/sdcard/ib_led/GreenOff..."
sleep 1
done
#execute gpio operation
cd /sys/class/gpio/
echo 199 > export
cd gpio199
echo out > direction
echo 0 > value
echo 1 > value
#remove flag
rm /data/data/com.example.hellojni/files/RedOff.txt
echo "Red Off done-----"
Here are the example code to access the light bar
HelloJni.java
public void ledLightOperate(int GorR, int OnOff)
{
try {
if (GorR == 1) // green light
{
if (OnOff == 1)
{ // turn on
// write file to internal storage
String FILENAME = "GreenOn.txt";
String filewords = "GreenOn";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(filewords.getBytes());