Page 1 of 1

Using switches to set a count value

Posted: Thu Oct 04, 2012 3:45 pm
by Stagdriver
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

Re: Using switches to set a count value

Posted: Thu Oct 04, 2012 4:49 pm
by Benj
Hello,

Welcome to the forums. Please can you sign up and use the relevant topic for your version of Flowcode.

http://www.matrixmultimedia.com/forum_upgrades.php

or for the demo version.

http://www.matrixmultimedia.com/mmforum ... m.php?f=49

Here is a quick example written in v5.
LoopDemo.fcf
(6 KiB) Downloaded 419 times

Re: Using switches to set a count value

Posted: Fri Oct 05, 2012 9:44 pm
by Stagdriver
Did not expect it to be just so easy to collect the count from the switches. I had been head scratching for hours, Many thanks for that.
Next step hardware
I can see the benefit of working through the tutorials though.
Many thanks again, i will properly register with version 5 just as soon as i receive my order bundle via Amazon.