Flowcode6

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
buvaylov
Posts: 10
Joined: Wed Sep 30, 2020 5:27 am
Contact:

Flowcode6

Post by buvaylov »

Hello! Please help with an example of entering a value (for example 1155, 8888... 4125) from the keyboard into a variable integer type

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: Flowcode6

Post by Benj »

Hello,

To do something like this you would have a routine like this. Written in pseudocode.

Code: Select all

done = 0
var = 0
while (done != 1)
{
  key = ReadKeypad()
  if (key < 255)
  {
    if (key > 9) then done = 1
    if (key <= 9) then var = (var * 10) + key
  }
  while (key < 255)
  {
    key = ReadKeypad()
  }
}
Hope this helps.

User avatar
buvaylov
Posts: 10
Joined: Wed Sep 30, 2020 5:27 am
Contact:

Re: Flowcode6

Post by buvaylov »

Hello! Thanks for the example. Please indicate an error in the attached file. It is necessary to reflect the value of the variable(var) on the indicator. Thanks in advance
Attachments
1. Keypad.fcfx
(6.74 KiB) Downloaded 146 times

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: Flowcode6

Post by medelec35 »

Hi buvaylov,
Does this work better for you?
Attachments
1. Keypad.fcfx
(7.2 KiB) Downloaded 146 times
Martin

User avatar
buvaylov
Posts: 10
Joined: Wed Sep 30, 2020 5:27 am
Contact:

Re: Flowcode6

Post by buvaylov »

Hello Martin! Thank you for your help. I am making a winding machine and want to know if I can contact you for project advice in the future. Regards, Alexandr

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: Flowcode6

Post by medelec35 »

Hi Alexandr,
Your welcome.
If you get stuck, then I will help you if I can.
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: Flowcode6

Post by medelec35 »

Hi Alexandr,
Can you ask for help via main forums please and not via PM as its against forum rules.
Issues with your flowchart is you need to add a LCD start component before the main loop:
LCD1.png
LCD1.png (7.67 KiB) Viewed 4676 times
&
Within configuration settings, you will need to change RC to XT as RC is only If you have an external resistor and capacitor connected and not a crystal or resonator.
Martin

Post Reply