Issues with connecting a slideswitch to change between automatic and manual mode for a fan

This needs attention.

float speed1 = (value/1024.0) * 255.0 ; /****/ // with float, use .0 on integers