#include <wiringPi.h>

#include <stdio.h>
#include <stdlib.h>



int main(int argc, char *argv[])
{
      if(getuid()!=0) //wiringPi requires root privileges
      {
        printf("Error:wiringPi must be run as root.\n");
        return 1;
      }
      if(wiringPiSetup()==-1)
      {
        printf("Error:wiringPi setup failed.\n");
        return 1;
      }


		printf("PWM sur sortie GPIO18\n");

        pinMode(1,PWM_OUTPUT); // Initialisation PWM sur broche WPi1
        pwmSetMode(PWM_MODE_MS);
        pwmSetRange(100);	// 100 paliers de variation possibles
        pwmWrite(1,0);      // PWM à 0%

while(1)
      {
          pwmWrite(1,100);

      }

  return 0;
}
