Using switches to set a count value
Posted: Thu Oct 04, 2012 3:45 pm
Hi i am new here and have spent the past few day creating a few theoretical projects to see how i get on with Flowcode, all good so far, money well spent i think. I have looke through much of the discussion and i feel i need a bit of catching up.
Now my first real project.
I am looking to be able to use three switches to set a value between 1 and 7 (proposing to use Ports A0,A1 and A2 presumably using a combination of 1,2and 4 to set a number up to 7 of the type 0-255) and then use this value to set a loop count between 1 and 7.
I think this is probably quite simple, but cannot currently see the wood for the trees.
I have managed to create the main sequence to intelligently share a smart motorcycle battery maintainer between 1 and 7 bikes in a correct manner that allows the charger to properly initialise at each 48 hour change-over but would like to refine the system to allow me to set the number of bikes by using the three switches rather than re-program the chip each time and hard setting the count value.
I would appreciate anyones help who can nudge me in the right direction
Best regards
Now my first real project.
I am looking to be able to use three switches to set a value between 1 and 7 (proposing to use Ports A0,A1 and A2 presumably using a combination of 1,2and 4 to set a number up to 7 of the type 0-255) and then use this value to set a loop count between 1 and 7.
I think this is probably quite simple, but cannot currently see the wood for the trees.
I have managed to create the main sequence to intelligently share a smart motorcycle battery maintainer between 1 and 7 bikes in a correct manner that allows the charger to properly initialise at each 48 hour change-over but would like to refine the system to allow me to set the number of bikes by using the three switches rather than re-program the chip each time and hard setting the count value.
I would appreciate anyones help who can nudge me in the right direction
Best regards