#include "wiringPi.h"
#include "softPwm.h"
-#define MAX_PINS 64
+#define MAX_PINS 1024
// The PWM Frequency is derived from the "pulse time" below. Essentially,
// the frequency is a function of the range and this pulse time.
return NULL ;
}
+
+/*
+ * softPwmWrite:
+ * Write a PWM value to the given pin
+ *********************************************************************************
+ */
+
void softPwmWrite (int pin, int value)
{
+ pin &= (MAX_PINS - 1) ;
+
+ /**/ if (value < 0)
+ value = 0 ;
+ else if (value > range [pin])
+ value = range [pin] ;
+
marks [pin] = value ;
}