How to perform keypad as a calculator
-
- Posts: 35
- Joined: Wed Dec 27, 2017 4:18 pm
- Has thanked: 7 times
- Been thanked: 6 times
- Contact:
How to perform keypad as a calculator
Hello,
I wondered if anyone would be able to perform a keypad as a calculator. I trying to create program which adds two numbers under 9999. Eg I enter 1,2,8 and then press * to add and then enter 3,4,7 and press # to = these numbers. So 128 + 347 = 475. Ive attached what I have created at the moment
Thanks in advance for all your help
Jac
I wondered if anyone would be able to perform a keypad as a calculator. I trying to create program which adds two numbers under 9999. Eg I enter 1,2,8 and then press * to add and then enter 3,4,7 and press # to = these numbers. So 128 + 347 = 475. Ive attached what I have created at the moment
Thanks in advance for all your help
Jac
- Attachments
-
- ex 9 prog 2.fcfx
- (11.23 KiB) Downloaded 304 times
-
- 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: How to perform keypad as a calculator
Hi Jac,
If the result is going to be greater than 255, then don't use a byte as the maximum value of bytes is only 255.
I did a flowchart for Flowcode V5 some time ago that adds two numbers together.
Take a look here.
Martin
If the result is going to be greater than 255, then don't use a byte as the maximum value of bytes is only 255.
I did a flowchart for Flowcode V5 some time ago that adds two numbers together.
Take a look here.
Martin
Martin
-
- Posts: 35
- Joined: Wed Dec 27, 2017 4:18 pm
- Has thanked: 7 times
- Been thanked: 6 times
- Contact:
Re: How to perform keypad as a calculator
Hi,
This is for flow code 5, is there anyway you can convert it to flow code 7 or explain how the program works?
Cheers
Jac
This is for flow code 5, is there anyway you can convert it to flow code 7 or explain how the program works?
Cheers
Jac
-
- 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: How to perform keypad as a calculator
Flowcode7 is designed to load Flowcode 5 fcf files.
Run Flowcode, Select Open project (or File, Open).
Change drop down box next to file name from to
Then you can open .fcf files.
Martin
Run Flowcode, Select Open project (or File, Open).
Change drop down box next to file name from
Code: Select all
Flowcode project files (*.fcfx)
Code: Select all
Flowcode for PIC files (*.fcf)
Martin
Martin
-
- Posts: 35
- Joined: Wed Dec 27, 2017 4:18 pm
- Has thanked: 7 times
- Been thanked: 6 times
- Contact:
Re: How to perform keypad as a calculator
Hi,
I will try and dissect the program later on. Can I ask what 10 and 11 represent in the switch icon? And is there meant to be a display result empty macro?
Thanks a lot
jac
I will try and dissect the program later on. Can I ask what 10 and 11 represent in the switch icon? And is there meant to be a display result empty macro?
Thanks a lot
jac
-
- 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: How to perform keypad as a calculator
Code: Select all
10 = *
Code: Select all
11 = #
No there is not. I have just loaded V5 Flowchart in v7 and: MartinJacob1 wrote:And is there meant to be a display result empty macro?
Martin
-
- Posts: 35
- Joined: Wed Dec 27, 2017 4:18 pm
- Has thanked: 7 times
- Been thanked: 6 times
- Contact:
Re: How to perform keypad as a calculator
Hi medelec35,
Yeah sorry for some reason the macro flowchart didn't show when i first downloaded it. Could you explain what the number = (number* 10) + key means? I'm guessing the result and number are the two values which are added. Also, The display result macro converts the number into a string and then displays this, but why is there then a second loop with the until = key
Thanks for your help
Jac
Yeah sorry for some reason the macro flowchart didn't show when i first downloaded it. Could you explain what the number = (number* 10) + key means? I'm guessing the result and number are the two values which are added. Also, The display result macro converts the number into a string and then displays this, but why is there then a second loop with the until = key
Thanks for your help
Jac
-
- 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: How to perform keypad as a calculator
See if you can find out what is going on by adding all variables to simulation debugger then work out what you think should happen.
Then use F8 to step into and see if you was correct in your assumption.
You could also disable the loop and see what affect it has.
Worth spending a fair bit of time in the simulation to see if you can work it all out.
Then use F8 to step into and see if you was correct in your assumption.
You could also disable the loop and see what affect it has.
Worth spending a fair bit of time in the simulation to see if you can work it all out.
Martin
-
- Posts: 35
- Joined: Wed Dec 27, 2017 4:18 pm
- Has thanked: 7 times
- Been thanked: 6 times
- Contact:
Re: How to perform keypad as a calculator
Hi,
Wondered if anyone knows how to assign a space to the button * for example? I am having trouble with this, and have looked at previous forum posts. One post seemed to use the variable = variable + 2 in order to skip to the next space with a decision which says "key press = decimal value according to the keypad symbol. I have tried this but I cant seem to get it to work, as I am using different variables. I have attached the program below, which is basically a mobile phone but I want to be able to insert a space when the * button is pressed
Also, the display can only show 9 characters before a random number is shown which is another problem, changing the string size doesn't affect this or the variable size used, such as Ulong or int.
I would also like to say that I have used the principles of martins calculator program for this that he posted on here, I would like to thank him for showing this example to me in the first place!
Thanks
Jac
Wondered if anyone knows how to assign a space to the button * for example? I am having trouble with this, and have looked at previous forum posts. One post seemed to use the variable = variable + 2 in order to skip to the next space with a decision which says "key press = decimal value according to the keypad symbol. I have tried this but I cant seem to get it to work, as I am using different variables. I have attached the program below, which is basically a mobile phone but I want to be able to insert a space when the * button is pressed
Also, the display can only show 9 characters before a random number is shown which is another problem, changing the string size doesn't affect this or the variable size used, such as Ulong or int.
I would also like to say that I have used the principles of martins calculator program for this that he posted on here, I would like to thank him for showing this example to me in the first place!
Thanks
Jac