OK, I've removed the breadboard connection from the EasyPic5 and configured the board to use the 10K pot on the EasyPic5. I have the USB/Serial breakout board connected to +5v, GND and GPIO.5 and confirmed the communications were OK in the serial monitor window. I've added the correct setting for the comparators (must of removed the 0 at the end of the statement when editing the file- my bad).
Loading the code I can get 0 - 1023 by moving the wiper on the EasyPic5 board, so the chip is reading 0-5v and converting that to a digital value.
I then added back the lines for the motor control, making them GPIO.2 and 4, and hooked up the H-Bridge on the breadboard - I added the trigger of 100 in the line "if number >100 then turn on the motor" and watched what happened when I turned the pot on the easyPic5 board and low and behold, when the value hit 101 the motor came on......
I'm going to pull all the connections off the breadboard and re-check the wiring - seems that the issue is external and not the code. One possible cause could be the resistance / capacitance nature of the breadboard causing the issue ??
Anyway, thanks guys for your comments and input.... as always it's nice to receive assistance and helps with the learning curve
Malcolm
Bookmarks