Re: 12F683 - basic code not working
Check the risistence of your LDR in both condition (dark and light). Since the lowest resistance should be found in light, use this value for your devider network. In this way you should have a value in volts near to zero in dark and near to Vdd/2 in light, more than enough to be sure to trip the system at the right time.
By the way the schematics of your Hbridge is wrong! NPN should be connected on the low side, while PNP should be connected on the high side.
Follow the wise suggestion given above, always use freewheel diodes when using inductors!
Cheers
Al.
Last edited by aratti; - 19th January 2014 at 20:43.
All progress began with an idea
Bookmarks