Question about programming the fx-CG50 - Does programming take place only on the calculator directly, or can a program be written on a PC and transferred to the fx-CG50? If it is the latter, then what PC app might be used to create the program? Thank you!
fx-CG50 - Programming
#1
Posted 09 September 2018 - 12:55 PM
#2
Posted 10 September 2018 - 11:21 AM
It seems you can write a program in the computer e.g. in notepad and transfer it to the calculator.
Everything is described in the UG, page 8-7 - Converting Programs and Text Files with examples how to write characters in program and text file.
#3
Posted 10 September 2018 - 03:02 PM
You can program on the calculator itself in basic. I think you can use a program like fa-124 or just a text editor to edit/create files. I think you can just drag and drop files to the calculator since it is using mass storage. I'm unsure how to program add-ins (c, c++, ASM). I think the community has created SDK for it but I'm unsure of where to look.
This is for the prizm, which is all I could find, maybe they are so similar they are compatible.
http://prizm.cemetec...gramming_Portal
#4
Posted 11 September 2018 - 01:38 PM
Thank you to both pan.gejt and GodOfCows for your very helpful responses. I don't know how I missed pg 8-7 in the manual, but I did.
Cheers!
#5
Posted 11 September 2018 - 03:46 PM
Can you confirm it if you decide to test it? I am a little bit lazy to write any program as a text file and transfer it to calculator.
#6
Posted 12 September 2018 - 03:34 PM
Can you confirm it if you decide to test it? I am a little bit lazy to write any program as a text file and transfer it to calculator.
I tested it and it works. I first created a program for Heron's formula on the calculator and made sure it worked. Then I created a text file with a different name for the same program, using the conversion text at the end of chapter 8 of the UG. Plugged the calculator into a USB port and copied the program to the program folder on the calculator. The program ran just like the one I had created right on the calculator. HOWEVER - there are some things to know.
1) A text file moved from a PC to the program folder under @MainMem/Program is automatically converted from text file to a program when the USB connection is terminated. Note: USB termination must occur on the PC before unplugging the USB cable. Text files may be copied from the PC to other directories in the calculator without the automatic text-to-program conversion.
2) I used NotePad on Windows to create the program and that worked. I tried a different text editor and that did not work - not sure why. I kept getting "conversion failed" error message on the calculator with no information as to what failed. It might have been because it saved the file in some other text format than ASCII, or perhaps it was because the file did not have a .txt file extension.
3) Casio BASIC on the calculator uses a number of special symbols that are not in the ASCII character set, however, towards the end of chapter 8 of the UG, there is a conversion table that shows what to type in the text document in order to get the special character on the calculator. For example, to get the triangle image that means "display", in the text document you would type Disps.
The NotePad text file code for Heron's formula is shown below.
"Side a"?->A "Side b"?->B "Side c"?->C (A+B+C)/2->S Sqrt(S*(S-A)*(S-B)*(S-C))->R "Area is" RDisps
For those who may not be familiar with Heron's formula, it calculates the area of any triangle, not just a right-triangle, when given its three sides.
Disclaimer - there is no error checking for having a negative value under the radical. This can occur if the inputted side lengths do not actually make a triangle.
Anyway, Pan.Gejt, I hope you give it a try and let me know how it turns out.
Cheers!
Edited by Todd, 12 September 2018 - 03:40 PM.
#7
Posted 15 September 2018 - 12:43 PM
You can also program the CG-50 in Micropython (a variant of standard python) which you can write on your desktop in a text editor or in IDLE and then just upload the file anywhere on the calculator's memory. Just make sure you have the latest version of the OS to use python.
#8
Posted 16 September 2018 - 04:44 AM
#9
Posted 16 September 2018 - 10:28 AM
Sentaro21 and Space928, thank you both for your suggestions. I will try them both. I did notice that the CG50 has a Python environment, and I have done some programming in Python, but nothing serious.
To Sentaro21: I noticed that you have an HP Prime calculator. I had one of those about a year ago and really liked it because of the smaller form factor as compared to the TI nSpire CX CAS, and the HP had several more higher math application than the TI. However, during a calculus II refresher course, my HP kept giving me wrong answers. I got the feeling that HP had not worked out all the bugs yet. I sold the calculator and went back to using the TI.
Cheers!
#10
Posted 20 October 2020 - 08:35 PM
I use BIDE. it is perfect for this since i can make a program on pc
Edited by Shadow Emperor H3LLFIR3, 20 October 2020 - 08:35 PM.
#11
Posted 10 April 2022 - 07:27 PM
Hello guys, maybe you can help me.
I have written a programm with Python in TigerJython about Pascall's Triangle and it's working on PC but when I transver it to my Caculator (fx-CG50) and try to run it, it's saying there is a syntax error (invalid syntax).
Do you know what it could be?
if it helps thats the code:
input_num = int(input("anzahl zeilen:"))
list = []
for n in range(input_num):
list.append([])
list[n].append(1)
for m in range(1,n):
list[n].append(list[n-1][m-1]+list[n-1][m])
if(input_num != 0):
list[n].append(1)
for n in range(input_num):
print(""*(input_num - n), end = "", sep = "")
for m in range(0, n + 1):
print('{0:5}'.format(list[n][m]),end ="", sep ="")
print()
#12
Posted 10 April 2022 - 07:35 PM
This program i short. You may delte some lines and look what happens.
I don't have a cg50 but a cg20 (without Python). But I suspect the rather complicated print lines are the reason.
#13
Posted 16 April 2022 - 09:00 AM
if(<expr>)
But it's discouraged and it seems like the calculator does not support it.
Your code instead should be
input_num = int(input("anzahl zeilen:")) list = [] for n in range(input_num): list.append([]) list[n].append(1) for m in range(1,n): list[n].append(list[n-1][m-1]+list[n-1][m]) if input_num != 0: list[n].append(1) for n in range(input_num): print(""*(input_num - n), end = "", sep = "") for m in range(0, n + 1): print('{0:5}'.format(list[n][m]),end ="", sep ="") print()
Edited by HappyCalc, 16 April 2022 - 09:16 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users