View unanswered posts | View active topics It is currently Thu Aug 21, 2014 8:07 am






Reply to topic  [ 4 posts ] 
txt files with robotc 
Author Message
Rookie

Joined: Mon Sep 01, 2008 2:20 am
Posts: 1
Post txt files with robotc
Hi all,
I want to prerpare a project in which txt files are uploaded to the NXT brick, these files should include coordinates of a obstacles in a room , then the brick should locate an object locates somewhere in the room (such as the Hitechnic IR ball) and once it has it's distance (via US) and direction (according to IRseeker and compass) then it should calculate a path in which the obstacles are avoided.

this is the general idea, I might change it a bit, but what I would like to know is if anyone has any experience with using data files in RobotC? is it at all possible with RobotC?

Any tip would be welcome,
Tnx
AdiDACT


Mon Sep 01, 2008 2:34 am
Profile
Rookie
User avatar

Joined: Wed Apr 30, 2008 7:05 am
Posts: 18
Location: Brisbane, QLD
Post Re: txt files with robotc
yeah i was using text files a bit for my thesis storing data and using it to load configuration data. The text file read/write aren't too bad and seemed to work fairly quickly - just have to realise that unlike real C once you have called the openWrite() command and have closed the file handle that no more data can be written to a file but u can read as many times as you like - apparently the NXT supports 16 file operations simultaneously. Other thing to note is that you are using flash memory so if u intend read and write from files alot i would recommend reading the data into to say an array or something and using the data from there - i forgot i was using flash memory for a few days and probably burnt through like half of the read/write cycle lifespan of the flash memory :cry:

_________________
experiencing slow death by thesis


Mon Sep 01, 2008 6:13 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: txt files with robotc
nxt flash memory: only about 10 thousand writings all over!
Flash-memory AT91SAM7S256 :
Quote:
Features
......
• 256 Kbytes of Internal High-speed Flash, Organized in 1024 Pages of 256 Bytes
– Single Cycle Access at Up to 30 MHz in Worst Case Conditions
– Prefetch Buffer Optimizing Thumb Instruction Execution at Maximum Speed
– Page Programming Time: 4 ms, Including Page Auto-erase, Full Erase Time: 10 ms
10,000 Write Cycles, 10-year Data Retention Capability, Sector Lock Capabilities,

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Mon Sep 01, 2008 6:23 am
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 614
Post Re: txt files with robotc
Quote:
Features
......
• 256 Kbytes of Internal High-speed Flash, Organized in 1024 Pages of 256 Bytes
– Single Cycle Access at Up to 30 MHz in Worst Case Conditions
– Prefetch Buffer Optimizing Thumb Instruction Execution at Maximum Speed
– Page Programming Time: 4 ms, Including Page Auto-erase, Full Erase Time: 10 ms
10,000 Write Cycles, 10-year Data Retention Capability, Sector Lock Capabilities,

Fortunately the most common failure mode of the 10K write cycles is that flash memory retention time is reduced from 10 years instead of failures resulting in hard memory errors.


Wed Sep 17, 2008 9:23 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.