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

Post Reply
User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Help us choose the next Flowcode Video subject

Post by DavidA »

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: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: Help us choose the next Flowcode Video subject

Post by jgu1 »

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 = fadd(float, float) - Add two floating point numbers together

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.

Thank´s in advance.

Best regard
JGU

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Help us choose the next Flowcode Video subject

Post by Spanish_dude »

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: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: Help us choose the next Flowcode Video subject

Post by jgu1 »

Hi Nicolas! :D


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.

thanks for your care.

best regards

jgu1

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: Help us choose the next Flowcode Video subject

Post by Jordy101091 »

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: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: Help us choose the next Flowcode Video subject

Post by jgu1 »

Hi Team!

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

Best regard

jgu1

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Help us choose the next Flowcode Video subject

Post by medelec35 »

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:

FCV_DELAY_MS=Delay_Val[FCV_ADC_VAL];

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
Has thanked: 35 times
Been thanked: 12 times

Re: Help us choose the next Flowcode Video subject

Post by daveb0360 »

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
Has thanked: 474 times
Been thanked: 458 times

Re: Help us choose the next Flowcode Video subject

Post by dazz »

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
(336.26 KiB) Downloaded 10325 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Has thanked: 35 times
Been thanked: 12 times

Re: Help us choose the next Flowcode Video subject

Post by daveb0360 »

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
Has thanked: 474 times
Been thanked: 458 times

Re: Help us choose the next Flowcode Video subject

Post by dazz »

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
(635.25 KiB) Downloaded 911 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Has thanked: 35 times
Been thanked: 12 times

Re: Help us choose the next Flowcode Video subject

Post by daveb0360 »

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
Has thanked: 474 times
Been thanked: 458 times

Re: Help us choose the next Flowcode Video subject

Post by dazz »

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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: Help us choose the next Flowcode Video subject

Post by Enamul »

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

Post Reply