Writing data to files

2 replies [Last post]
untulis
untulis's picture
Title: NooBot
Joined: 06/01/2011
Posts:
BotPoints: 3
User offline. Last seen 49 weeks 3 days ago.

I have looked through the InteractiveC and the Kiss-C documentation and I have not been able to find any information about saving data to a file from inside a program.

In other c compilers, I can do a fprintf, but I do not see that in the documentation.Is it possible to print data to a file and if so how?

Thanks

Chuck

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 841
User offline. Last seen 22 min 56 sec ago.

Hi Chuck, welcome to the Botball Community! (Apologies for the late reply, I've been busy.) KISS-C uses GCC with the full standard C library, so fprintf should work fine just as it would with any other C compiler. The KISS-C documentation only lists functionality that KIPR directly offers support for (mainly robotics-specific stuff), but this shouldn't discourage you from using other functionality -- just do so knowing that KIPR won't be able to help you with it.

If you write some code using fprintf and it doesn't work, feel free to post the code here, and hopefully someone will be able to help you.

Good luck!

-Jeremy Rand
Senior Programmer, Team SNARC (2012), Norman Advanced Robotics (2010-2011), Norman High (2008-2009), Norman North (2005-2007), Whittier Middle School (2003-2004)
2012 VP of Comm, 2011 President, Botball Youth Advisory Council (2009-2012)

scottmil
scottmil's picture
Title: MiniBot
Joined: 05/10/2010
Posts:
BotPoints: 37
User offline. Last seen 47 weeks 1 day ago.

I've done this several times. But, I don't have my hard drive with me that has the code. I believe you need to mount a usb drive, and then in code open a file on it, write to file, close file.

Scott

All is fair in love and war, and botball is both :)