Beispiel #1
0
Datei: pi.go Projekt: rafkhan/pi
func callWiringSetup(flags int) error {
	if flags&SETUP_WIRING == SETUP_WIRING {
		C.wiringPiSetup()
		fmt.Println("testing")
		return nil

	} else if flags&SETUP_GPIO == SETUP_GPIO {
		C.wiringPiSetupGpio()
		return nil

	} else if flags&SETUP_PHYS == SETUP_PHYS {
		C.wiringPiSetupPhys()
		return nil

	} else if flags&SETUP_SYS == SETUP_SYS {
		C.wiringPiSetupSys()
		return nil

	} else {
		return errors.New("No setup flag set")
	}
}
Beispiel #2
0
func WiringPiSetup() error {
	if -1 == int(C.wiringPiSetup()) {
		return errors.New("wiringPiSetup failed to call")
	}
	return nil
}
Beispiel #3
0
func WiringPiSetup() {
	if -1 == int(C.wiringPiSetup()) {
		panic("Failed to setup Pi")
	}
}