Jump to content



Photo
- - - - -

fx-CG50 - Programming


  • Please log in to reply
12 replies to this topic

#1 Todd

Todd

    Newbie

  • Members
  • Pip
  • 14 posts
  • Gender:Male
  • Location:Payson, AZ
  • Interests:Astronomy, electronics, computers, and of course, math.

  • Calculators:
    fx-CG500 - My "daily driver" (actually, CP-400)
    fg-CG50
    fx-991EX Classwiz
    fx-9750gii
    fx-9750giii
    TI-89 Titanium
    TI-83 Silver Edition
    TI-nSpire CX CAS

Posted 09 September 2018 - 12:55 PM

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!



#2 pan.gejt

pan.gejt

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:CZ

  • Calculators:
    .

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 GodOfCows

GodOfCows

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male

  • Calculators:
    fx-9860gii, fx-9750gii, TI-92, TI-89, TI-83 Plus

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 Todd

Todd

    Newbie

  • Members
  • Pip
  • 14 posts
  • Gender:Male
  • Location:Payson, AZ
  • Interests:Astronomy, electronics, computers, and of course, math.

  • Calculators:
    fx-CG500 - My "daily driver" (actually, CP-400)
    fg-CG50
    fx-991EX Classwiz
    fx-9750gii
    fx-9750giii
    TI-89 Titanium
    TI-83 Silver Edition
    TI-nSpire CX CAS

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 pan.gejt

pan.gejt

    Casio Freak

  • Members
  • PipPipPipPip
  • 264 posts
  • Gender:Male
  • Location:CZ

  • Calculators:
    .

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 Todd

Todd

    Newbie

  • Members
  • Pip
  • 14 posts
  • Gender:Male
  • Location:Payson, AZ
  • Interests:Astronomy, electronics, computers, and of course, math.

  • Calculators:
    fx-CG500 - My "daily driver" (actually, CP-400)
    fg-CG50
    fx-991EX Classwiz
    fx-9750gii
    fx-9750giii
    TI-89 Titanium
    TI-83 Silver Edition
    TI-nSpire CX CAS

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 space928

space928

    Newbie

  • Members
  • Pip
  • 4 posts
  • Gender:Male
  • Location:France/Switzerland
  • Interests:Computing
    Science
    Programming (C, C#, HLSL, and rarely ASM)
    Theatre
    Maths

  • Calculators:
    fx83-gt PLUS
    And occasionally: fx92 Spéciale College

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 sentaro21

sentaro21

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:JAPAN

  • Calculators:
    FX-603P fx-4800P fx-5800P
    CFX-9850GC PLUS
    fx-9860G
    fx-9860GII
    fx-9860GII-2
    fx-9860GII-2 SD
    fx-CG10
    fx-CG20
    fx-CG50
    HP-Prime
    HP 50G
    TI-Nspire CX CAS
    TI-84+CE

Posted 16 September 2018 - 04:44 AM

Python supported newly is good for high speed. :D
 
If feel that genuine Casio Basic is slow,
If you are interested, please try C.Basic CG. 
The all the commands do not support, but the basic command works at 10 times faster or more. :greengrin:


#9 Todd

Todd

    Newbie

  • Members
  • Pip
  • 14 posts
  • Gender:Male
  • Location:Payson, AZ
  • Interests:Astronomy, electronics, computers, and of course, math.

  • Calculators:
    fx-CG500 - My "daily driver" (actually, CP-400)
    fg-CG50
    fx-991EX Classwiz
    fx-9750gii
    fx-9750giii
    TI-89 Titanium
    TI-83 Silver Edition
    TI-nSpire CX CAS

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 Shadow Emperor H3LLFIR3

Shadow Emperor H3LLFIR3

    Newbie

  • Members
  • Pip
  • 19 posts
  • Gender:Male

  • Calculators:
    Casio CG-50
    Casio FX-9860G Slim
    Casio fx-9750 GII

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 Lost_Player

Lost_Player

    Newbie

  • Members
  • Pip
  • 3 posts

  • Calculators:
    fx-CG50

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 piu58

piu58

    Casio Freak

  • Members
  • PipPipPipPip
  • 147 posts
  • Gender:Male

  • Calculators:
    Casio Graph 90+E, Casio fx-CG20

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 HappyCalc

HappyCalc

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:
    fx-9860GII-2
    fx-CG50

Posted 16 April 2022 - 09:00 AM

Python normally supports
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