Hi, That's not too difficult ... to use it with PBP

1) Pi (3.141592654 ...)
replace it by integer fraction like 22/7 or 355/113

2) here, angles are expressed in radians ... just change to BINARY radians PBP can deal with
2*pi rads = 360° = 255 binary radians ...

and keep a sharp eye on overflows ( depending on the processor used : 16F - 16 Bits unsigned, 18F with longs - 31 signed bits )

That's all !!!

looks it applies to a resistive load ( lamp, heather ...) but not to inductive loads ... like motors.

Alain