Toggles the LED torch (flashlight) on the device.
Usage #
package main
import (
t "github.com/hugmouse/gotermux"
)
func main() {
// Turn on the torch
t.TermuxTorch(true)
// Turn off the torch
t.TermuxTorch(false)
}Parameters #
on bool- Set totrueto enable torch,falseto disable
The function will log “Turning on the LED torch” or “Turning off the LED torch” to indicate the action being performed.