As far as i know Adc_read will read an 8 bit value by default and set it to adc_val..so when vin=0 i want duty cycle to be 0.(off) when vin = 255(5v) i would like the motor to be at full speed.
I'm still working on my code, im kinda stuck/busy but im gonna try to figure it out tonight.