I am just getting started with C, so I thought I'd create this thread to keep people updated on my progress and use the thread if I have any questions. It is long overdue that I move on from TI-Basic, so I will be trying to avoid doing any other big projects in that language from now on. I already have a bit of experience in computer C programming from the previous school year, but it was specifically for simple input/output within the IDE. This thread is dedicated to my CE C programming in general.

I already have my directory set up including the toolchain, so it is easy to create however many programs I want from the template. So far I have made a simple home screen text output program, as well as a movement program for the home screen which allows you to control a character "O" within the 10x26 bounds. My next idea is to try a fruit-ninja swiping test program, similar to the TI-Basic one I made but improved.
Good luck with this, you've made incredible programs in BASIC so I'm really looking forward to seeing what you can do with C!
Fruit ninja CE sounds like a fun project, I tried to recreate it in ICE a long time ago but it fell to the wayside when I started my HDpic project again. I can share some of the code if you'd like. Smile
Thanks! Well as I said I'm a bit new to this, so I have some questions that may seem simple but:

1. Should I or should I not use the os_GetCSC() input for getting a stream of key presses into a list from a finger swipe across the keyboard?
2. If not, then how exactly would I do this? Keep in mind, even TI-Basic worked very fast and accurately for the most recent test program I made. I just need some help getting key swipes into a list.
3. Perhaps a very very simple question but If I am storing the result of os_GetCSC() to key, what value/result is in variable key if nothing has been pressed? Or is it enough to say "If (key) { ... }"? Or "If (key>0) { ... }"?
1. Use kb_Scan().
2. Use kb_Data.
3. See above.
I am making slow progress, I know it's been a few days but I'm trying to figure out the keypadc.h library/header... perhaps if someone is willing, the wiki can have more examples on it sometime?

Right now I am stuck on getting a unique key code into a variable so I can turn it into a coordinate on the graph screen. Yes I've looked at the wiki, yes I've looked at the header documentation but I still haven't been able to do what I want. Any help?

Also, how might I tell if a key pressed is the [math] button or beyond?
Have you even looked at any of the examples? That's what they are for.
So..... progress! This uses [math] in the top left through [enter] at the bottom right.

But... terribly unoptimized code

 * Program Name:CSWIPE
 * Author:Michael2_3B
 * License:MIT
 * Description:An experimental C program to swipe like you do in fruit ninja.

/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>

/* Standard headers (recommended) */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* Other headers I included */
#include <graphx.h>
#include <keypadc.h>

/* Put your function prototypes here */

/* Put all your globals here */

void main(void) {
    /* Fill in the body of the main function here */
    kb_key_t key;
    //int myList[];
    int i=0;
    double x;
    double y;

    do {
       if (kb_Data[2]) {
          key = kb_Data[2];
          if(key == kb_Store)
          if(key == kb_Ln)
          if(key == kb_Log)
          if(key == kb_Square)
          if(key == kb_Recip)
          if(key == kb_Math)
       if (kb_Data[3]) {
          key = kb_Data[3];
          if(key == kb_0)
          if(key == kb_1)
          if(key == kb_4)
          if(key == kb_7)
          if(key == kb_Comma)
          if(key == kb_Sin)
          if(key == kb_Apps)
       if (kb_Data[4]){
          key = kb_Data[4];
          if(key == kb_DecPnt)
          if(key == kb_2)
          if(key == kb_5)
          if(key == kb_8)
          if(key == kb_LParen)
          if(key == kb_Cos)
          if(key == kb_Prgm)
       if (kb_Data[5]) {
          key = kb_Data[5];
          if(key == kb_Chs)
          if(key == kb_3)
          if(key == kb_6)
          if(key == kb_9)
          if(key == kb_RParen)
          if(key == kb_Tan)
          if(key == kb_Vars)
       if (kb_Data[6]) {
          key = kb_Data[6];
          if(key == kb_Enter)
          if(key == kb_Add)
          if(key == kb_Sub)
          if(key == kb_Mul)
          if(key == kb_Div)
          if(key == kb_Power)
          if(key == kb_Clear)
       if(x>0 & y>0){
       } else {

    } while (kb_Data[1] != kb_2nd);

Whenever I run my program, the sprites I've made all come out in varying shades/brightnesses of green. Now that I have 4 more sprites, all of them look different than what they should.

I initially thought this was a convpng issue with not processing colors correctly, but then I realized it worked fine on the watermelon earlier. Anyone know what's wrong?

EDIT: Nevermind. I forgot to set the palette.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum