Calculator Community > Calculator C

How to get input from user in ndless sdk ?

(1/7) > >>

Mohammed Elborolossy:
Hi
I'm a new user and my calc is TI Nspire CX CAS
First: How can i write code in c++ not c ?
Second :I'm good in c++ but i can't make input from user how can i do this ?
Third : I write a code in c and I use "scanf()" to take input from user and when I test it on emulator , the emulator stuck what the problem ?
Forth : What is the important include that i should write before the program ? " the program contains input from user "
Fifth and least : is there any tutorial "pdf or videos " for programming ti nspire cx cas ? can I make a GUI app ?

Vogtinator:

--- Quote ---Hi
I'm a new user and my calc is TI Nspire CX CAS
First: How can i write code in c++ not c ?
--- End quote ---
Use .cpp as file extension, not .c.


--- Quote ---Second :I'm good in c++ but i can't make input from user how can i do this ?
--- End quote ---
Use nspire-io, directly or indirectly. The new SDK at https://github.com/ndless-nspire/Ndless has nspire-io support built-in, just look at samples/newlib.
You can use scanf, std::cin, ifstream, whatever you like.


--- Quote ---Third : I write a code in c and I use "scanf()" to take input from user and when I test it on emulator , the emulator stuck what the problem ?
--- End quote ---
It waits for serial input. By default std* are the first UART.


--- Quote ---Forth : What is the important include that i should write before the program ? " the program contains input from user "
--- End quote ---
?


--- Quote ---Fifth and least : is there any tutorial "pdf or videos " for programming ti nspire cx cas ? can I make a GUI app ?
--- End quote ---
There is only http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction_on_Linux. You can use some graphics libs like nSDL, n2dlib or nGL or rip an existing program apart and use its GUI stuff, like pyWrite.

Mohammed Elborolossy:
Thank you for reply


--- Quote ---Use nspire-io, directly or indirectly. The new SDK at https://github.com/ndless-nspire/Ndless has nspire-io support built-in, just look at samples/newlib.
You can use scanf, std::cin, ifstream, whatever you like.
--- End quote ---
What is the header file that i will include it will be "#include <nspire-io> ?


--- Quote ---It waits for serial input. By default std* are the first UART.
--- End quote ---
This is my code (I still learning and test small codes)

#include <os.h>
int main() {
   printf ("!!!Hello World!!!");
   int x ;
   scanf("%d" , &x);
   printf ("The  value is : %d" , x)
   return 0;
}
What is the problem for this code (The prog not start to write an input)


--- Quote ---Forth : What is the important include that i should write before the program ? " the program contains input from user "
--- End quote ---
I mean what is the main (#include <>) that without it the app doesn't run ?


--- Quote ---Fifth and least : is there any tutorial "pdf or videos " for programming ti nspire cx cas ? can I make a GUI app ?
There is only http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction_on_Linux. You can use some graphics libs like nSDL, n2dlib or nGL or rip an existing program apart and use its GUI stuff, like pyWrite.
--- End quote ---

can you give me link contains example for GUI code ?
Thanks in advance

Vogtinator:

--- Quote from: Mohammed Elborolossy on November 17, 2014, 03:57:31 pm ---Thank you for reply


--- Quote ---Use nspire-io, directly or indirectly. The new SDK at https://github.com/ndless-nspire/Ndless has nspire-io support built-in, just look at samples/newlib.
You can use scanf, std::cin, ifstream, whatever you like.
--- End quote ---
What is the header file that i will include it will be "#include <nspire-io> ?
--- End quote ---
#include <nspireio/nspireio.h>


--- Quote ---
--- Quote ---It waits for serial input. By default std* are the first UART.
--- End quote ---
This is my code (I still learning and test small codes)

#include <os.h>
int main() {
   printf ("!!!Hello World!!!");
   int x ;
   scanf("%d" , &x);
   printf ("The  value is : %d" , x)
   return 0;
}
What is the problem for this code (The prog not start to write an input)
--- End quote ---
Try a newline or puts instead of printf.

--- Quote ---
--- Quote ---Forth : What is the important include that i should write before the program ? " the program contains input from user "
--- End quote ---

I mean what is the main (#include <>) that without it the app doesn't run ?
--- End quote ---
There is no such #include, although you need to #include <os.h> on the old sdk to do something useful.



--- Quote ---
--- Quote ---Fifth and least : is there any tutorial "pdf or videos " for programming ti nspire cx cas ? can I make a GUI app ?

There is only http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction_on_Linux. You can use some graphics libs like nSDL, n2dlib or nGL or rip an existing program apart and use its GUI stuff, like pyWrite.
--- End quote ---

can you give me link contains example for GUI code ?
--- End quote ---
That depends on how you want to do GUI development, which library you use.




--- Quote ---
Thanks in advance

--- End quote ---

Mohammed Elborolossy:
for the GUI
I still in the start and I don't know anything of them
So I wish you recommend me anyone of them to start learn it
I need a simple gui .

Navigation

[0] Message Index

[#] Next page

Go to full version