Page 2 of 2

Re: BL0032 windspeed

Posted: Tue Oct 01, 2019 1:17 pm
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?

Re: BL0032 windspeed

Posted: Tue Oct 01, 2019 3:07 pm
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?

Re: BL0032 windspeed

Posted: Tue Oct 01, 2019 5:19 pm
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!

Re: BL0032 windspeed

Posted: Wed Oct 02, 2019 6:08 am
by Monie Jacobsen
Hi medelec35
That is a good suggestion:-)
Is it something you want to help with a Code example?

Re: BL0032 windspeed

Posted: Wed Oct 02, 2019 7:52 pm
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.

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 7:15 am
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 426 times

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 8:09 am
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.

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 10:12 am
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?

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 11:03 am
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.

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 11:32 am
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;-)

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 12:57 pm
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

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 1:06 pm
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

Re: BL0032 windspeed

Posted: Thu Oct 03, 2019 3:08 pm
by Monie Jacobsen
Hi medelec35
Thank you very much
Have a good evening...

Re: BL0032 windspeed

Posted: Tue Feb 18, 2020 12:59 am
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?

Re: BL0032 windspeed

Posted: Tue Feb 18, 2020 6:55 pm
by wayne millard
See example of frequency measurement.

Wayne

Re: BL0032 windspeed

Posted: Wed Feb 19, 2020 12:17 am
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.

Re: BL0032 windspeed

Posted: Wed Feb 19, 2020 12:22 am
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.

Re: BL0032 windspeed

Posted: Sat May 01, 2021 6:17 pm
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

Re: BL0032 windspeed

Posted: Sat May 01, 2021 11:55 pm
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?

Re: BL0032 windspeed

Posted: Sun May 02, 2021 8:54 am
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

Re: BL0032 windspeed

Posted: Sun May 02, 2021 9:48 am
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