Author Topic: Post your Nspire routines here!  (Read 98842 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Post your Nspire routines here!
« Reply #165 on: September 12, 2010, 02:58:31 pm »
Ah.
This would be better than the current function, where you'd have to make sure the seed is different each time the prog is run.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Post your Nspire routines here!
« Reply #166 on: September 12, 2010, 05:44:57 pm »
Here is a simple routine to set the LED a certain color.  It does not support blinking.  I know it is kinda useless, but I though I would post it anyway.  Pass it 0 to turn the LED off, 1 to make it green, 2 to make it red, or 3 to make it yellow:

Code: [Select]
void set_led(int color) {
*(volatile unsigned*) 0x90110B00=0x00;
switch(color) {
case 0:
break;
case 1:
*(volatile unsigned*) 0x90110B00=0x10;
break;
case 2:
*(volatile unsigned*) 0x90110B00=0x20;
break;
case 3:
*(volatile unsigned*) 0x90110B00=0x30;
};
}


Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Post your Nspire routines here!
« Reply #167 on: September 12, 2010, 07:55:56 pm »
It's actually not necessary to write 0 first unless you are using the blinker. A simplified version of this routine would be

*(volatile unsigned*) 0x90110B00 = color << 4;
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

SirCmpwn

  • Guest
Re: Post your Nspire routines here!
« Reply #168 on: October 27, 2010, 10:38:37 am »
So I got the skeleton downloaded and set up under Ndless 1.7.  However, using MinGW to compile it, it tells me "make: arg-elf-gcc: Command not found" and errors out.
Any idea why?
EDIT: Got that working, but now objcopy won't work.
"arm-elf-objcopy: Command not found"
« Last Edit: October 27, 2010, 10:46:58 am by SirCmpwn »

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Post your Nspire routines here!
« Reply #169 on: October 27, 2010, 10:53:04 am »
If you are using Ndless 1.7, I don't think a skeleton is required anymore.

Are you using YAGARTO v4.5.1 or later? Then the GCC and binutils commands used in your Makefile should begin with "arm-none-" instead of "arm-elf-".

I also suggest you use the Makefile template provided in the samples/hello directory of Ndless v1.7. You can also try to begin with the step-by-step tutorial available on Hackspire: http://hackspire.unsads.com/wiki/index.php/C_and_assembly_development_introduction
Ndless.me with the finest TI-Nspire programs

SirCmpwn

  • Guest
Re: Post your Nspire routines here!
« Reply #170 on: October 27, 2010, 04:44:43 pm »
Thanks, and I went through that tutorial, it works great :)
I want to get the libraries from the skeleton working, though, I'll post more specific errors in a few.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Post your Nspire routines here!
« Reply #171 on: October 28, 2010, 04:07:51 am »
Aren't bwang's functions now packed as a static library? This is really the best way to make code available to other developers.
We can add tutorials on how to build and import static libraries to Hackspire if needed.
Ndless.me with the finest TI-Nspire programs

SirCmpwn

  • Guest
Re: Post your Nspire routines here!
« Reply #172 on: October 28, 2010, 08:13:58 am »
Well, not knowing what that means, I can't really answer it.  I got it working, though.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Post your Nspire routines here!
« Reply #173 on: October 28, 2010, 01:17:53 pm »
There is a static version lurking somewhere on this thread. I probably should update the OP and change skeleton to just a set of libraries, since it is no longer necessary for Ndless 1.7.

SirCmpwn

  • Guest
Re: Post your Nspire routines here!
« Reply #174 on: October 28, 2010, 04:44:33 pm »
Good idea.  Right now I'm just using the libraries.

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: Post your Nspire routines here!
« Reply #175 on: May 20, 2013, 09:26:56 pm »
*NECROBUMP*

Is there a clipped sprite routine?
I like milk.

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Post your Nspire routines here!
« Reply #176 on: May 21, 2013, 08:18:20 am »
Have you looked in nRGBlib ?
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: Post your Nspire routines here!
« Reply #177 on: May 21, 2013, 05:24:06 pm »
Have you looked in nRGBlib ?

I didn't see a clipped sprite.
I like milk.

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: Post your Nspire routines here!
« Reply #178 on: May 21, 2013, 05:51:30 pm »
Isn't the normal sprite routine already clipped?

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Post your Nspire routines here!
« Reply #179 on: May 21, 2013, 06:29:30 pm »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua