set gpio to rdwr if direction out
diff --git a/includes/gpio.c b/includes/gpio.c
index 6fed039..25a9df8 100644
--- a/includes/gpio.c
+++ b/includes/gpio.c
@@ -217,7 +217,7 @@
 	else
 	{
 		sprintf(buf, "%s/gpio%d/value", gpio->dev, gpio->num);
-		gpio->fd = open(buf, O_WRONLY);
+		gpio->fd = open(buf, O_RDWR);
 
 	}
 	if (gpio->fd == -1) {