Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 03:16:42 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 10 11 [12]   Go Down
  Print  
Author Topic: Post your Nspire routines here! -  (Read 15232 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
t0xic_kitt3n
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 01:56:35
Date Registered: 16 June, 2010, 20:46:00
Location: w,x,y,z
Posts: 1583


Total Post Ratings: +32

View Profile
« Reply #165 on: 12 September, 2010, 20:58:31 »
0

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.
Logged




██████  ██  ██  ███████           ████    ██    ██   ██ ███████
█ ██ █  ██  ██   ██   █          ██  ██  ████   ███ ███  ██   █
  ██    ██  ██   ██             ██   ██ ██  ██  ███████  ██    
  ██    ██  ██   ██  █         ██       ██  ██  ███████  ██  █
  ██    ██████   █████         ██       ██  ██  ██ █ ██  █████ 
  ██    ██  ██   ██  █         ██   ███ ██████  ██   ██  ██  █
  ██    ██  ██   ██             ██   ██ ██  ██  ██   ██  ██    
  ██    ██  ██   ██   █          ██  ██ ██  ██  ██   ██  ██   █
 ████   ██  ██  ███████           █████ ██  ██  ██   ██ ███████

apcalc
The Game
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 12 May, 2013, 20:31:24
Date Registered: 20 March, 2010, 16:31:47
Location: 2003 UB313
Posts: 1393


Total Post Ratings: +118

View Profile
« Reply #166 on: 12 September, 2010, 23:44:57 »
0

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:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
};
}
Logged


calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 10:02:35
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #167 on: 13 September, 2010, 01:55:56 »
0

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;
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
SirCmpwn
Guest
« Reply #168 on: 27 October, 2010, 16:38:37 »
0

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: 27 October, 2010, 16:46:58 by SirCmpwn » Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 May, 2013, 08:07:39
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #169 on: 27 October, 2010, 16:53:04 »
0

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
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
SirCmpwn
Guest
« Reply #170 on: 27 October, 2010, 22:44:43 »
0

Thanks, and I went through that tutorial, it works great Smiley
I want to get the libraries from the skeleton working, though, I'll post more specific errors in a few.
Logged
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 17 May, 2013, 08:07:39
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #171 on: 28 October, 2010, 10:07:51 »
0

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.
Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
SirCmpwn
Guest
« Reply #172 on: 28 October, 2010, 14:13:58 »
0

Well, not knowing what that means, I can't really answer it.  I got it working, though.
Logged
bwang
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 11 August, 2012, 12:59:06
Date Registered: 20 June, 2009, 01:42:58
Posts: 632

Topic starter
Total Post Ratings: +19

View Profile
« Reply #173 on: 28 October, 2010, 19:17:53 »
0

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.
Logged
SirCmpwn
Guest
« Reply #174 on: 28 October, 2010, 22:44:33 »
0

Good idea.  Right now I'm just using the libraries.
Logged
Pages: 1 ... 10 11 [12]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.309 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.