Sending a file in NXC
Sending a file in NXC
Can you send a file through Bluetooth in NXC? Something like "SendFile()"?
-Dud
I got my name changed. I like it better
-Dud
I got my name changed. I like it better
2Labz.com, My Website
Re: Sending a file in NXC - update
Don't know about a file but Philo built a joystick which links 2 nxt units using nxt-g so there must be some useful hints there (http://www.philohome.com/nxtjoystick/joystick.htm). I know someone was sending info using lejos because I cane across a reference to it - google is your friend.
Have just found some info about bt communication on this website http://robotics.benedettelli.com/BT_NXC.htm. Just going to download and read it myself!
Have just found some info about bt communication on this website http://robotics.benedettelli.com/BT_NXC.htm. Just going to download and read it myself!
A sophistical rhetorician, inebriated with the exuberance of his own verbosity, and gifted with an egotistical imagination that can at all times command an interminable and inconsistent series of arguments to malign an opponent and to glorify himself.
Re: Sending a file in NXC
Check out INTF_SENDFILE or INTF_SENDDATA.dudmaster wrote:Can you send a file through Bluetooth in NXC? Something like "SendFile()"?
Use it with CommExecuteFunctionType.
[Edited]
Code: Select all
#define BT_CONN 1
task main()
{
CommExecuteFunctionType args;
args.Cmd = INTF_SENDFILE;
args.Param1 = BT_CONN;
args.Name = "virus.rxe";
SysCommExecuteFunction(args);
}
Isn't that illegal? Did your parents approve? Or are you secretly 42 years old?My name is chicken wrote:I got my name changed. I like it better
Last edited by muntoo on 08 Feb 2011, 00:19, edited 5 times in total.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: Sending a file in NXC
The INTF_SENDFILE function also requires that you tell it the name of the file you want to send via the Name field in the CommExecuteFunctionType structure. This should work just like it does when you use the UI menu system to send a file from one NXT to another.
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: Sending a file in NXC
is there a similar way to send a file to a PC via USB?
How has the destination path to the target directory to be specified?
How has the destination path to the target directory to be specified?
Re: Sending a file in NXC
You could look into the Fantom SDK stuff (or whatever, I think that's what it's for..., right?), if you want to download from the PC.doc-helmut wrote:is there a similar way to send a file to a PC via USB?
How has the destination path to the target directory to be specified?
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: Sending a file in NXC
There is no automatic way to send a file from the NXT to a PC via USB. You need to have a program running on the PC use various system commands over a USB connection to read the file from the NXT and write it to the PC. I guess you could open a file and then start writing to the USB output buffer but that would not do anything unless you have a custom written program running on your PC to do something with the data on the USB connection.
I understood the original question to be about sending a file from one NXT to another but if it was about sending a file to a PC then the comm module function Muntoo mentioned will not work.
John Hansen
I understood the original question to be about sending a file from one NXT to another but if it was about sending a file to a PC then the comm module function Muntoo mentioned will not work.
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: Sending a file in NXC
ok, thx, I see.
Maybe there is someone around who once has written such a program for the PC to pick up a file from NXT and store it in a PC folder?
Maybe there is someone around who once has written such a program for the PC to pick up a file from NXT and store it in a PC folder?
Re: Sending a file in NXC
You mean NeXTExplorer? Maybe John could provide some source code/link?doc-helmut wrote:ok, thx, I see.
Maybe there is someone around who once has written such a program for the PC to pick up a file from NXT and store it in a PC folder?
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: Sending a file in NXC
muntoo,
no, what I mean are program(s) which let me automatically store a file (created by my NXC program) into a PC folder (sent by USB), e.g. every time when I press a specific NXC button. The different file names are counted automatically like
FILE001.TXT
FILE002.TXT
FILE003.TXT
...
It's for my speech recognition program as you may guess:
I record a sound pattern
The pattern is written to a file which is stored on the flash
Next, I may press a NXT Btn to send it to the PC.
Then the file will be erased from the flash to free memory.
As I have to do it very often (60-100 times or more) the NXTexplorer is too tortuously.
no, what I mean are program(s) which let me automatically store a file (created by my NXC program) into a PC folder (sent by USB), e.g. every time when I press a specific NXC button. The different file names are counted automatically like
FILE001.TXT
FILE002.TXT
FILE003.TXT
...
It's for my speech recognition program as you may guess:
I record a sound pattern
The pattern is written to a file which is stored on the flash
Next, I may press a NXT Btn to send it to the PC.
Then the file will be erased from the flash to free memory.
As I have to do it very often (60-100 times or more) the NXTexplorer is too tortuously.
Who is online
Users browsing this forum: Semrush [Bot] and 2 guests