RaspberryPiwithGolang

// This program achieves LED blink on Raspberry Pi with Go lang. // This is implemented with hard-coding and uses only main function. package main import ( "fmt" "os" "time" ) func main() { // Initialize GPIO25 fmt.Println("Initialize GPIO25") fd, err := os.OpenFile("/sys/class/gpio/export", os.O_WRONLY|os.O_SYNC, 0666) if err != nil { fmt.Println("open /sys/class/gpio/export fails") fmt.Println(err) return } fmt.Fprint(fd, "25") fd.Close() // Check iinitialization result fmt.Println("Check initialization result") _, err = os.Stat("/sys/class/gpio/gpio25")