c++ - GPIO programming in C for raspberry PI -
i ve got gpio program in python .. me in getting equivalent c or c++ program run on raspberry pi ..
the python code
import rpi.gpio gpio import time # blinking function def blink(pin): gpio.output(pin,gpio.high) time.sleep(1) gpio.output(pin,gpio.low) time.sleep(1) return # use raspberry pi board pin numbers gpio.setmode(gpio.board) # set gpio output channel gpio.setup(11, gpio.out) # blink gpio17 50 times in range(0,50): blink(11) gpio.cleanup()
thanks in advance! :)
#include <header.h> // contatining delay function void blink(int pin) { //program pin (which gpio) high //delay function //program pin (which gpio) low //delay return 0; } main() { // use raspberry pi board pin numbers gpio.setmode(gpio.board) //check fun def , find out doing , code accordingly // set gpio 11 output channel // blink gpio11 50 times for(i=0;i<50;i++) blink(11); gpio.cleanup() ////check fun def , find out doing , code
Comments
Post a Comment