Converted arduino sketch to wiringPi inside ruby extension