This is a hello world program for a golang (Go) program.
The program is developed on a Mac computer and the binary is cross compiled for the Raspberry Pi architecture (GOOS=linux GOARCH=arm GOARM=5
).
The program prints "Hello World" on std out, blinks a LED 10 times (5 times per second) and then fades a LED (using PWM) up and down 5 times.
All pin control is performed using go library go-rpio.
Wire a LED (with resistor in serial) to a ground pin (like physical pin 6) and to GPIO pin 10 (which corresponds to physical pin 19).
Note
|
Check the polarity of the LED. If it is not flashing when you run the program, try to flip the LED +/- sides. ;) |