Programming a barrier on Flowcode

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
MoonLight68
Posts: 1
Joined: Wed Mar 08, 2017 5:12 pm

Programming a barrier on Flowcode

Post by MoonLight68 »

Hello everyone :D !
I wanted to create a parking lot model, and I'm working on Flowcode in order to manage the LED's etc..
However I got a little problem, I need to program the barrier, and I'm completely lost :( (I'm a beginner on Flowcode).
So I wanted to know if someone here can help me for the program of my barrier, to open and to close it, also there are 2 LED's, a green and a red one, which are turned on while the barrier opens/closes.
Thank you :)

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Programming a barrier on Flowcode

Post by Benj »

Hello and Welcome,

Why not have a go, see how far you get and then post your project so far and we can help guide you in the right direction.

This page is applicable to you.
http://www.matrixtsl.com/mmforums/viewt ... 54&t=17511

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

Re: Programming a barrier on Flowcode

Post by Docara »

Hi Moonlight,

I feel Benj was a little unhelpful in his answer but right in why he was saying it.

Most of the battle with FC is (in my opinion) is poor documentation so if you are coming from knowhere it is a bit of a learning curve. For very basic LED illumination and similar if you look at the 'tutorials' you will get an idea on how to proceed.

Regards to you project (I'm assuming you can do the basic electronics for resistors, break beams etc) you will need to use the Inputs, output, delays and probably compare loops (if you are reading more than one led/detector) to get some sort of basic functionality.

So at a very basic level and to start you off, assuming an led is on continuously and you are reading the 'light' via a detector. Set up a continuous loop then within that read (Input Macro or Switch Input Macro) a pin on the microcontroller which the detector is connected, compare it to 'something' to see if what you are reading is the value you want. Then (optionally) do something via the Output macro, you might have to put a delay in then loop around again.

I the tutorials look at the points I mentioned above then expand on it, also look at adding LED component to a microcontroller because the principle is valid for other things

Your question is too open ended to give a precise answer, hopefully I have pointed you in a direction for you to get answers yourself

Matt

Post Reply