Can't get switches to work in the simulator

For general Flowcode discussion that does not belong in the other sections.
Post Reply
nheather
Posts: 6
http://meble-kuchenne.info.pl
Joined: Sat Oct 01, 2022 6:15 pm
Been thanked: 1 time

Can't get switches to work in the simulator

Post by nheather »

A relative to is being asked to use FlowCode to teach Design and Technology at BTEC level has asked me to look at the software as she and her students are struggling with it.

I have the software installed as a Free Trial and am working through the examples in the online Introduction book.

I am early on and have reached the example where I have Port B connected to a 5 LED array and Port A connected to a 5 Slide Switch Array

Port A sets a variable called SENSOR

Port B reads the variable called SENSOR

So when I simulate using debug the LEDs should simply mimic the switch positions.

I am confident that I have the component set up correctly in the project.

My problem is that when I click on the switches (in the 3D or 2D panel makes no difference) nothing happens. I'm expecting them to animate and their values change between 0 and 1.

But I can click on the switch until I am blue in the face - nothing happens.

Any ideas?

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: Can't get switches to work in the simulator

Post by p.erasmus »

Hi,

It is all ways the best if you upload your Flowcart in this way people can see and simulate your Flowchart and help you out :D

Just as a thought without seeing yourflowchart,if you are expecting to see the LED dim or bright by moving the slider it will not happen as the micro pin are digital only , in this case push buttons will be better anycase upload your Flowchart that we talk about the actual Chart and code
Regards Peter - QME Electronics

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can't get switches to work in the simulator

Post by chipfryer27 »

Hi

As stated above it's best to include your chart.

I (and I'm very sure others will too) highly recommend Flowcode as it allows very complex code and embedded projects to be created without actually writing any code.

Have a look at the attached example which reads the switch array and then displays status on LEDs. When simulating (Debug > Go), clicking the switch array changes status. Note that you can use pretty much any chip as your target as FC doesn't care (generally speaking).

Have you updated components? Go to Library Components and do a Full Database Update. Sometimes a bug is discovered, then fixed, but you need to update to ensure you are using the latest.

Hope this helps.

Regards
Attachments
Example.fcfx
(9.72 KiB) Downloaded 47 times

nheather
Posts: 6
Joined: Sat Oct 01, 2022 6:15 pm
Been thanked: 1 time

Re: Can't get switches to work in the simulator

Post by nheather »

No problem uploading my FlowChart - though there really is nothing to it - and I'm not entirely sure what I should actually upload and how - I have a saved project file (.fcfx), is that what you mean.

But I think you have misunderstood my question - I'm not talking about the flowchart logic but the operation of the switch array object depicted in the 2D and 3D panels.

This is where you go

Component Libraries > Inputs > Switch Array (Slide) > Add to 3D system panel (or add to 2d dashboard panel)

My understanding is that these graphical representations of switches should be interactive, should animate and change state when clicked.

I have two issues with this aspect of the FlowCode software

1) When the Switches or indeed LEDs are added to either the 2D or 3D panel they are tiny - I mean so small they are pretty hard to see at all. To make them useable I have to select them and drag them to make them larger. If that is how the User Interface is meant to work, then it is not very good.

2) Regardless of whether I leave them small or enlarge them, regardless of whether they are on the 2D or 3D panel they do not animate. When I click on them nothing happens at all. They don't animate, they don't change state.

BTW - all I am doing is following the introduction codes in the FlowCode book under education found here

https://flowcode.co.uk/education/

Example 1 - pages 48 to 51

On page 51 it states

"Move the cursor over one of the switches and click, to simulate detecting a fire. The switch graphic toggles to
the closed position."

That doesn't happen - the switches do not interact; they just behave like static graphics.

nheather
Posts: 6
Joined: Sat Oct 01, 2022 6:15 pm
Been thanked: 1 time

Re: Can't get switches to work in the simulator

Post by nheather »

This is my project - see attached
Attachments
Flowcode2.fcfx
(9.72 KiB) Downloaded 52 times

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can't get switches to work in the simulator

Post by chipfryer27 »

Hi

Your flowchart works fine for me. Have you updated components?

I agree that some components when initially placed can be tiny, needing to be resized. Off hand I can't remember why but if you do a search re such the reason will be explained.

Regards

PS
You need to actually be in Simulation Mode for switches etc to change state (Debug > Go)

nheather
Posts: 6
Joined: Sat Oct 01, 2022 6:15 pm
Been thanked: 1 time

Re: Can't get switches to work in the simulator

Post by nheather »

I think there is something wrong with the switches in my install. I have just tried a rotary switch and that works fine - but none of the slide or toggle switches work.

How do I update the component database - all I have done is downloaded and installed a few hours ago.

Cheers,

Nigel

nheather
Posts: 6
Joined: Sat Oct 01, 2022 6:15 pm
Been thanked: 1 time

Re: Can't get switches to work in the simulator

Post by nheather »

Never mind - found the library update under help - there was only one update available, but it was called 'switches'. Downloaded that and the switches work as expected now.

Thanks for the help

chipfryer27
Valued Contributor
Posts: 1175
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

Re: Can't get switches to work in the simulator

Post by chipfryer27 »

Hi

When you first start FC you will see an Icon in the top ribbon that states Library Update. Click this then ensure Full Database is selected.

Capture-1.JPG
Capture-1.JPG (30.82 KiB) Viewed 1636 times

Capture-2.JPG
Capture-2.JPG (36.84 KiB) Viewed 1636 times

Regards

Post Reply