Random doesn't work.

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
wtulp
Flowcode V4 User
Posts: 10
Joined: Mon Jan 11, 2010 12:59 pm
Contact:

Random doesn't work.

Post by wtulp »

Hello,

I have the following question:
- the random-function doesn't work in my program
- in the attachment (random.fcf) is a loop that waits for a press of switch SW0
- while the switch is not pressed a random number is generated (variable rnd)
- when the switch is pressed the variable rnd is displayd on the lcd-display

In the Supplementary Code i have set:
#include <rand.h>

The parameters in Linker: (Compiler Options)
-ld "C:\Program Files\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic16.lib flowcode.pic16.lib float.pic16.lib rand.pic16.lib "%f.obj" -t PIC%p -d "%d" -p "%f"

I have the E-Blocks Multiprogrammer EB-006-00-7 with Flowcode4
My processor is PIC16F877a

Can somenone help me please!!


W. Tulp
random.fcf
random
(6 KiB) Downloaded 258 times

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: Random doesn't work.

Post by Benj »

Hello,

I have changed your C code for the Flowcode supported random function and this is now working correctly.
Attachments
random.fcf
(6 KiB) Downloaded 289 times

wtulp
Flowcode V4 User
Posts: 10
Joined: Mon Jan 11, 2010 12:59 pm
Contact:

Re: Random doesn't work.

Post by wtulp »

Thanks,

It works very fine now.

Post Reply