## Help us choose the next Flowcode Video subject

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

DavidA
Matrix Staff
Posts: 1066
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Contact:

### Help us choose the next Flowcode Video subject

Hey All,

I am dropping this subject in here for you guys who dont visit the other forums, we are running a poll to decide which Flowcode Training Video we should do next, we would love it if you guys could help us choose which subject you want a video made on.

The link to the topic is here: http://www.matrixmultimedia.com/mmforum ... =26&t=9960

Thanks!!

David

jgu1
Posts: 1205
Joined: Tue Oct 06, 2009 9:39 am
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi David!

I'd like some examples of all these features. I know it´s lot of wishes.

Calculations

( ) - Parentheses.

= <> -Equal to, Not equal to.

+ - * / MOD - Addition, Subtraction, Multiplication, Division & Modulus.

< <= > >= - Less than, Less than or equal to, Greater than, Greater than or equal to.

>> << - Shift right, Shift left.

NOT AND OR XOR - NOT(inversion), AND, OR, Exclusive OR

NEXTBIT = LASTBIT >> 2 & MASK

AANDB = PORT_A AND PORT_B

INVX = NOT X

float = fsub(float, float) - Subtract two floating point numbers

float = fmul(float, float) - Multiply two floating point numbers

float = fdiv(float, float) - Divide two floating point numbers

float = fmod(float, float) - MOD function for floating point numbers

byte = isinf(float) - Checks to see if the floating point number is infinite

byte = isnan(float) - Checks to see if the floating point is not a number

byte = float_eq(float, float) - Compares two floating point numbers to see if they are equal

byte = float_ge(float, float) - Compares two floating point numbers to see if they are greater then or equal

best byte = float_gt(float, float) - Compares two floating point numbers to see if they are greater then

byte = float_le(float, float) - Compares two floating point numbers to see if they are less then or equal

byte = float_lt(float, float) - Compares two floating point numbers to see if they are less then

int = random() - Generates a random number -32768 <=> 32767

And how to use GLCD displayes.

Best regard
JGU

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi jgu1,
( ) - Parentheses.
Parentheses are used the same way as when doing basic calculation in math.
2 * ( 3 + 1 ) = 2 * 4 = 8
= <> -Equal to, Not equal to
Note1: I know Flowcode allows you to use '=' but it's actually '==' in C
Note2: I never tried '<>' in C, I always use '!='

These operation will return a boolean. If used in an if-statement:
if ( 1 == 0 ) -> This will give a value of 0 or false. The if value will not be executed.
if ( 1 != 0 ) -> This will give you a value of 1 or true. This if statement will be executed.
It should be the same if used in a calculation box.
+ - * / MOD - Addition, Subtraction, Multiplication, Division & Modulus.
+, -, * and / are pretty straight forward I think.
MOD (or '%') on the other hand is something not everyone knows how to use.
MOD returns the rest of a division.
Here's an example with integers :
2 / 2 = 1
2 MOD 2 = 0, because 2 - 2 * 1 = 0
3 / 2 = 1
3 MOD 2 = 1, because 3 - 2 * 1 = 1
10 / 3 = 3
10 MOD 3 = 1, because 10 - 3 * 3 = 1
< <= > >= - Less than, Less than or equal to, Greater than, Greater than or equal to.
This can be put together with the 'equal' or 'not equal' operations.
Some examples:

if (A > 10) -> This means that if A is ranged between ]-infinite; 10], this if statement will not be executed
On the other hand, if A is ranged between ]10; +infinite[, it will be executed.
]10; +infinite[ or [11; +infinite[ is the same if talking about integers.
Same thing applies to the other operations.
Also, these operations returns a boolean.
>> << - Shift right, Shift left.
This one is really useful when programming microcontrollers.
If you want to set or clear a bit on PORTX, you'll could use this operator to select which bit you want to set/clear.
Anyways, these shift registers are easy to use.
The easiest way to explain this would be a step by step on what happens when you use the shift operators.

A = 1 << 4 = 16
1 or 0000 0001 -> shift one time to the left -> 2 or 0000 0010 -> again -> 0000 0100 -> again -> 0000 1000 -> shift 4th time to the left -> 0001 000 or 16

Of course you can do this with other values than 1, but this is just an example.
NOT AND OR XOR - NOT(inversion), AND, OR, Exclusive OR
These are bitwise operators. They work just like when applying the same gates to a 1 or 2 bit input, but on a larger scale (8 / 16 bits).
NOT(1) = 254
0x0F AND 0xF0 = 0x00
0x0F OR 0xF0 = 0xFF
0x0F XOR 0x1F = 0x10
NEXTBIT = LASTBIT >> 2 & MASK
This is a combination of above operations, if you know how they work you can mask out some bits from a PORT or something like that.
Basic stuff when programming microcontrollers in C.

When reading an input or setting an output, Flowcode will do something like that. Check the C code if you're curious on how it's done.
Floating point functions
I'm not going to write an example for each one of them. You'll know what they do by reading the comment/text next to the function.
Just replace each float by a floating point variable and that's pretty much it.

Just to demonstrate :
float sub, value1 = 1.3, value2 = 3.5
sub = fsub(value2, value1) -> 3.5 - 1.3 = 2.2

Note: For the random function to work, you'll need to include the math header.

Hope this helps,

Nicolas

jgu1
Posts: 1205
Joined: Tue Oct 06, 2009 9:39 am
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Nicolas!

Thanks for your explanation and all of your examples, very educational. I have copied and saved them.
But now sought MM for some examples of video and many times you learn much faster when you see it in a video. I have learned a lot from the video which is at MM.

best regards

jgu1

Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi,

I have an idea for your next video subject.
Maybe you can show us how to interface the new graphical LCDs with something like touchscreen and rotary encoders.
And maybe on how to setup a working internet connection with a functional webpage to display adc values.

That would be nice

Regards Jordy
the will to learn, should not be stopped by any price

jgu1
Posts: 1205
Joined: Tue Oct 06, 2009 9:39 am
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Team!

Maybe you could make a video examble with RC5 code. How to use this component.

Best regard

jgu1

medelec35
Valued Contributor
Posts: 9015
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

### Re: Help us choose the next Flowcode Video subject

A suggestion for another Flowcode Video subject is interfacing C code into Flowcode.
Not a whole C course, but just enough to be able to get basic project working which require the use of C code.
E.g from one of my posts I have got:

So it could be explained about the format FCV_
Also if you want to assign a Flowcode variable with contents from a resister using FCV_TMR2_VAL = tmr2;
It could be be explained that TMR2_VAL has to be created normally in Flowcode but tmr2 does not as it is a register name.
This may seem obvious to a few people, but when you look a c code for the first time, what seems like basic to some is confusing to others.

Also format of REGISTER_NAME.bit_Name could be covered etc.

There are loads of posts scattered around about the usage of C Code, but would be nice in 1 easy to find video.

Martin
Martin

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Contact:

### Re: Help us choose the next Flowcode Video subject

Personally,
I find, although I understand how to put a flowcode together from a state machine point of view, It's syntax that constantly trips me up.
eg. what the hell does this mean..((Count>=LED_On) && (LED_Status=1))|| ((Count>=LED_Off) && (LED_Status=0))

What do the double && and the || mean, these are used a lot but make no sense to me........guesswork tells me that the '&&' means 'and' ...........the '||' might mean 'or'. But nowhere in the documentation, do these parameters get any explanation.

So, I would request a few pages of explanation on how they are used or implemented, with examples. A guide to proper syntax use would be invaluable to the target customer, who is, after all, not conversant with 'c' coding and wouldn't have a natural understanding of the intricacies of c or assembly coding.

Cheers
dave

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi dave

have a look at the attached pic the red dots are where you need to look in the help file(or in a flowchart add a calculation box, select properties, click on the question mark and it should get the correct helpfile page) , also in your flowcode v5 tools folder ,in the source boost folder is a manual for source boost the mathmatical functions are also in the with explanations

Regards
Dazz
Untitled.png

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Dazz,
Thanks for the info.....unfortunately, I am only working with v4 program which doesn't have the more detailed help file you display here.
However, I've noted the info so thanks......now I understand better.

Dave

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Dave

Have a look at t he sourceboost pdf as theres also an explanation in there, starts at page 48 ive attached it here

Regards
Dazz
boostc.pdf

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Dazz,

WOW, that's a lot to take in but very useful........very, very useful !

I can't actually find a sourceboost folder........mystery

Many thanks though,

Dave

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi Dave
My fault i meant to say boostc, the path to the folder should be like mine below

C:\Program Files\Flowcode\v5\Tools\boostc

Regards
Dazz

Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Contact:

### Re: Help us choose the next Flowcode Video subject

Hi,
As you are FCv4 user in your case..it will be
C:\Program Files\Matrix Multimedia\Flowcode V4\boostc
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com