BL0032 windspeed

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
It's just a great tool to have for Keyboards.

Very small problem that needs to be pressed 2 times to get the result from key # (=10)
Do you have a suggestion for this issue?
Best Regard
Monie

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

Re: BL0032 windspeed

Post by medelec35 »

I'm not sure why you will need to read the keypad again with

Code: Select all

 Keypad = keypad_EB014::GetNumber()
You can remove that and just use the Press Variable?
Attachments
BL0032_KeyPress.fcfx
(59.03 KiB) Downloaded 239 times
Martin

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

Re: BL0032 windspeed

Post by medelec35 »

Personally, if it was me, I would not try and press 2 keys at once.
I would have short key press for one function and long key press (.5 second and over) for a different function using the same key.
At least then with 12 keys you can have numbers 0 to 9 and 14 additional functions!
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
That is a good suggestion:-)
Is it something you want to help with a Code example?
Best Regard
Monie

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

Re: BL0032 windspeed

Post by medelec35 »

Try attached flowchart on hardware as it won't simulate well.
You will need to add the functions required for long press.
Long press function should work if key is pressed for .5 sec or longer.
Attachments
BL0032_KeyPress.fcfx
(62.4 KiB) Downloaded 225 times
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
You write = "You will need to add the functions required for long press."
How or where should I write "long press".
Where should I enter the codes by pressing KeyPress 11 and long pressing KeyPress 10 (5 sec long press)?

See attachment:
BL0032_KeyPress-001.fcfx
(62.88 KiB) Downloaded 305 times
Best Regard
Monie

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

Re: BL0032 windspeed

Post by medelec35 »

I Have changed Count variable to an Int, so you can have greater long key press times.
Monie Jacobsen wrote:
Where should I enter the codes by pressing KeyPress 11 and long pressing KeyPress 10 (5 sec long press)?

Function for long press 10 was added to the flowchart already, so you will need to drag from Long press 10 to Long Press 11.
I have also added comments to help.
Attachments
BL0032_KeyPress-002.fcfx
(63.96 KiB) Downloaded 232 times
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
Thank you very much for your answer!
But with just a single press of KeyPress 10 alone, the Clock Setting starts up!
I imagined that while holding down the keypad 11, pressing KeyPress 10 for 5 sec long press.
With this does not work?
Best Regard
Monie

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

Re: BL0032 windspeed

Post by medelec35 »

Hi Monie,
Monie Jacobsen wrote: I imagined that while holding down the keypad 11, pressing KeyPress 10 for 5 sec long press.
With this does not work?
medelec35 wrote:Personally, if it was me, I would not try and press 2 keys at once.
I would have short key press for one function and long key press (.5 second and over) for a different function using the same key.
The Flowchart only allows 1 key press at a time.
You need to only hold key 10 down for over a second.
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
Thank you so much for your great help.
I will use the feature according to your regulations ..
Have a really good working day;-)
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi everyone
The component of the series from Eblocks2 BL083 Relay
Anyone here who can make a code example of BL083 Relay with Eblocks2 dsPIC programs BL0032
And use PORTD/G
I can't find it in Component search
Best Regard
Monie

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

Re: BL0032 windspeed

Post by medelec35 »

Monie Jacobsen wrote:The component of the series from Eblocks2 BL083 Relay
Do you mean BL0183?
If so, it does not require a component within Flowcode.
It just requires a single output pin for each relay.
Output high = relay energised
Output low = relay de-energised
The Elocks2 datasheet shows the connections:
BL0183 Circuit.png
(65.45 KiB) Downloaded 1729 times
Martin

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: BL0032 windspeed

Post by Monie Jacobsen »

Hi medelec35
Thank you very much
Have a good evening...
Best Regard
Monie

claudemir
Posts: 58
Joined: Sat Nov 03, 2012 7:43 am
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: BL0032 windspeed

Post by claudemir »

Hello
I am having difficulty configuring the "IOC PORT" of the dsPic30f4013, this event that has 3 actions per interuption, rising edge, falling edge and both edges, I need to select falling edge, but only have both edges, this is a characteristic microcontroller or error when performing the interruption?
Attachments
ioc.jpg
ioc.jpg (63.73 KiB) Viewed 9811 times

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times
Contact:

Re: BL0032 windspeed

Post by wayne millard »

See example of frequency measurement.

Wayne
Attachments
Frequency Counter.fcfx
(23.46 KiB) Downloaded 126 times

claudemir
Posts: 58
Joined: Sat Nov 03, 2012 7:43 am
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: BL0032 windspeed

Post by claudemir »

Hello Wayne Millard
Thanks for answering, my question was because on 16f1937 I can select rising edge, falling edge, and both edges, and on dspic30f4013 I don't have that option? because I didn't find anything listed on the data sheet of dspic30f4013.
Attachments
IOC_.jpg
IOC_.jpg (40.26 KiB) Viewed 9793 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: BL0032 windspeed

Post by Benj »

Hello,

Yes sorry the 30F4013 only has interrupt on change available, no separate selection for rising/falling edge available on the silicone. You can detect the edge in software if required by monitoring the state of the pin inside the interrupt macro. For example if the pin is high inside the interrupt macro then the last interrupt was likely the rising edge.

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: BL0032 windspeed

Post by AbhijitR »

Hello! Martin
good evening

Thanks for this post, i understand that the key press is validated in the loop until the time or count is not finished, it will stay in that loop until count finished or key released, but my point was if i need to check the short or long key press without waiting in the loop (and continue doing rest operations in the main loop) then how that is possible.

To be simple i want to check the press of one button in normal operation (short press) and if the same button is pressed for long time (may be 10Sec) then it should eliminate the short function and perform the long press function
medelec35 wrote:
Thu Oct 03, 2019 8:09 am

Function for long press 10 was added to the flowchart already, so you will need to drag from Long press 10 to Long Press 11.
I have also added comments to help.
Kindly excuse to bother you on holiday.

EDIT: kindly excuse me Martin, may be i am wrong to ask if such a function of a single key in dual press time is possible.

Abhi

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

Re: BL0032 windspeed

Post by medelec35 »

Hi Abhi,
You could have the count variable incrementing anywhere within Main, but only if a key is pressed.
So Main will be the same as the loop but less tight.
Are you still using the keypad or just using a switch?
Martin

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: BL0032 windspeed

Post by AbhijitR »

Hi! Martin
good morning

Thanks for writing back, yes i am using just a single button, and i want to use this button for 2 different operations, one for short press and one for long press, unfortunately i am not finding how to avoid the short press function while i am still pressing the button for the long function.

Abhi

User avatar
AbhijitR
Posts: 298
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 279 times
Been thanked: 78 times
Contact:

Re: BL0032 windspeed

Post by AbhijitR »

Hi! Martin

i think i found the answer, at least working good in simulation, i will try to run on the hardware and update the result.

Abhi

Post Reply