Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 10:50:56 *
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 [2] 3   Go Down
  Print  
Author Topic: Controlling external hardware through Lua -  (Read 2652 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
cypressx1
LV3 Member (Next: 100)
***
Offline Offline

Last Login: Yesterday at 17:50:47
Date Registered: 26 March, 2011, 12:17:51
Posts: 45

Total Post Ratings: 0

View Profile
« Reply #15 on: 15 July, 2011, 15:09:22 »
0

Really good job.
Logged
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #16 on: 15 July, 2011, 19:21:44 »
0

Answer to Netham45:
The stuff that took so long to type was: 'while 1 do led("I") sleep(1) led("<3") sleep(1) led("Omnimaga") sleep(3) end'.
Its not the most easy thing to do while filming the whole thing, and typing with one hand Wink
Logged

pianoman
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 20 October, 2011, 04:23:28
Date Registered: 21 May, 2011, 19:13:57
Location: You can know that my current velocity is about 0 m/s.
Posts: 427


Total Post Ratings: +24

View Profile
« Reply #17 on: 15 July, 2011, 19:50:23 »
0

Holy cow!
Amazing, Jim! Cheesy
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #18 on: 17 July, 2011, 17:55:22 »
0

In case anyone wants it, you can find the Lua and the C (for the arduino) source code here: http://bwns.be/jim/arduino-ti.zip
Logged

Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 13 June, 2013, 19:29:09
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #19 on: 24 July, 2011, 23:09:38 »
0

In case anyone wants it, you can find the Lua and the C (for the arduino) source code here: http://bwns.be/jim/arduino-ti.zip

Arduino takes Processing as code Tongue Not C? Or can it also take C? I'm pretty sure it's Processing though.
Logged
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #20 on: 25 July, 2011, 07:29:02 »
0

Well, its Processing, but I think its valid C anyway :p
Logged

Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 13 June, 2013, 19:29:09
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Total Post Ratings: +174

View Profile
« Reply #21 on: 25 July, 2011, 13:53:07 »
0

Well, its Processing, but I think its valid C anyway :p

It's Processing then, and save it as .pde, not as .c Tongue
Logged
pianoman
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 20 October, 2011, 04:23:28
Date Registered: 21 May, 2011, 19:13:57
Location: You can know that my current velocity is about 0 m/s.
Posts: 427


Total Post Ratings: +24

View Profile
« Reply #22 on: 28 July, 2011, 18:41:12 »
0

This is a bit off topic, but if you can control external hardware, can you also control external files on the calculator?
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #23 on: 28 July, 2011, 19:05:48 »
0

If you mean files on the local calculator, you can access libraries with Lua.
If you mean something like an sdcard, no, because we can't get yet hardware input .
There is though a chance that you can connect an sdcard to the dock, but more research has to be done on it.
Logged

pianoman
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 20 October, 2011, 04:23:28
Date Registered: 21 May, 2011, 19:13:57
Location: You can know that my current velocity is about 0 m/s.
Posts: 427


Total Post Ratings: +24

View Profile
« Reply #24 on: 29 July, 2011, 17:47:42 »
0

I meant can you get data from other lua files on the local calculator (i.e. level data, high scores, etc.)?
Logged

ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 11 June, 2013, 05:10:51
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5688


Total Post Ratings: +360

View Profile
« Reply #25 on: 29 July, 2011, 18:06:25 »
0

I know I'm a bit late, but wow.  That video is epic. Cheesy
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #26 on: 29 July, 2011, 18:33:26 »
0

Thanks Cheesy
Logged

adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #27 on: 30 July, 2011, 07:11:02 »
0

I meant can you get data from other lua files on the local calculator (i.e. level data, high scores, etc.)?

Not really, the data has to be in the same .tns file, and then get retrieved with var.recall, which grabs a Maths activity variable and puts in in a Lua variable
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:26:08
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1736


Topic starter
Total Post Ratings: +180

View Profile WWW
« Reply #28 on: 30 July, 2011, 07:19:40 »
0

Adriweb, you can also use math.eval to execute a function in a library document (not in the current tns file) and return stuff saved there.
Logged

adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #29 on: 30 July, 2011, 07:29:01 »
0

yep, but I think that if you have a lot of calculations to do, importing the variables in Lua then do all your calculations within lua (and then var.store() the final result) is much faster than doing all the calculations in a math.eval() call, as it's calling the math 'server' (as they call it) everytime ...

EDIT : but I think it's fine if you have only a few calculations to make
« Last Edit: 30 July, 2011, 07:29:21 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Pages: 1 [2] 3   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.246 seconds with 31 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.