Hey,
I am still learning C, i have decided to first learn C extensivly (?) on the pc (windows environment(and dos)) because there are more tutorials for that. But i have some troubles converting to the sdk for casio. Would you please be so kind to add the source files? I have lots of trouble with the sscanf on the casio...
That's a good way to start.
![:D](/dot/public/style_emoticons/default/biggrin.png)
and yes i like your games ![:)](/dot/public/style_emoticons/default/smile.png)
Thanks!
I have lots of trouble with the sscanf on the casio...
...
also, would you please be so kind to write a sample application for calculating a*b=c with user input?
like
give a
give b
answer is c
Thanks anyhow
Recieving user input and placing the value into a variable is kind of tricky since scanf() is not supported. sscanf() is like scanf(), but scanff() reads from a buffer, unlike scanf() which reads from STDIN. The SDK is still kind of basic (can't do greyscales which is kind of disappointing, no serial communication functions however their ECON add-in which uses serial communications, lacking some crucial standard C functions, etc.) and right now CASIO isn't supporting it. However, you can program in Assembly, but CASIO states:
Please do not directly access hardware(ports, address, others) because if the calculator's OS is updated the Add-In applications might not operate.
However you could
simulate scanf() using these two functions: IsKeyUp() & IsKeyDown().
For example:
if(IsKeyDown(KEY_CTRL_XTT)){
key_a_pressed = 1;
} else {
key_a_pressed = 0;
}
This piece of code returns 1 if
![<span class=](/dot/public/style_emoticons/default/ALPHA.jpg)
Alpha' /> +
![[X,O,T]](/dot/public/style_emoticons/default/X.jpg)
has been pressed, if not, then it returns 0. To make it effective, you can place this inside a main loop like while(). For example:
while(true){
if(IsKeyDown(KEY_CHAR_A)){
key_a_pressed = 1;
} else {
key_a_pressed = 0;
}
// Just an example. Place more stuff.....
if(IsKeyDown(KEY_CTRL_EXIT)){
return 1;
}
}
The
Key Code List shows what values you may use with the IsKeyDown() and IsKeyUp() functions. If you need more help, please ask me.