Creating Library files

11 replies [Last post]
brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 26 weeks ago.

Our team is looking to move out some common functions from our two robots into a library file.

How do you download the multiple files to the CBC?

Thanks,
Brad A

Brad A.
Team 13-0624
Fairfield, IL

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 20 weeks ago.

If you're using KISS-IDE with C, put the common functions in a .h file (not a .c file), and use #include. For example, if your library file is library.h, use this:

  1. #include "library.h"

When you download the main program over USB cable, the library will be sent as well.

Normally in C, programmers are encouraged to put common functions in .c files, and use a linker to combine them into one executable; KISS-IDE does not support this. If you really want to be able to do this, I'd recommend using the CodeSourcery G++ ARM-Linux cross compiler, which you can easily integrate with the CodeBlocks IDE. Then you would simply copy over a binary via wifi. There's some information on this in the CBC Hacking 2010 paper which I co-authored; be warned that KIPR won't be able to help you with this, since they don't offer support for such things.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 26 weeks ago.

thanks for your help. Do you have a link to your paper, so I can learn more?

Thanks again!
Brad A

Brad A.
Team 13-0624
Fairfield, IL

brada
Title: NooBot
Joined: 03/23/2012
Posts:
BotPoints: 36
User offline. Last seen 8 years 26 weeks ago.

Nevermind, i found it.

http://community.botball.org/articles/hacking-cbc-botball-controller-bec...

Thanks again for the help

Brad A.
Team 13-0624
Fairfield, IL

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 20 weeks ago.

Actually the paper I was referring to is at http://community.botball.org/forum/technical/programming/cbc-hacking-201...

The paper you found is the prequel to that paper. If you choose to setup CodeSourcery and CodeBlocks, be aware that the KIPR firmware doesn't support rsync downloads (and the rsync-enabled firmware that we posted on GitHub is outdated). Your best bet would be to copy over the .bin file using SCP. I don't recall whether KIPR's firmware has a compile script for .bin files, but if they don't, you can just SCP it to /mnt/kiss/usercode/bin/robot and the program will be launched when you click the Run Program button on the CBC. (You can also add a .bin file compile script; it's not particularly hard if you have basic familiarity with shell scripts.)

Feel free to ask if you have any questions about this.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 34 weeks ago.

KISS IDE will support multiple source files this summer through a project system. Until then, I'd recommend Jeremy's solution.

Thanks.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

Ponivnret
Title: NooBot
Joined: 07/29/2016
Posts:
BotPoints: 22
User offline. Last seen 6 years 10 weeks ago.

That was an really impressive post and i like that.
192.168.o.1

debramoragandeb
Title: NooBot
Joined: 05/11/2017
Posts:
BotPoints: 20
User offline. Last seen 3 years 50 weeks ago.

This should be the first thing that we teach our students before we teach them to do loops and conditions. Everyone should know to make their own library file. It would help them in saving a lot of effort and time. learn arabic

panistefanin
Title: NooBot
Joined: 05/29/2017
Posts:
BotPoints: 64
User offline. Last seen 4 years 16 weeks ago.

Excellent post. Thank you very much!!
sprint corporate

panistefanin
Title: NooBot
Joined: 05/29/2017
Posts:
BotPoints: 64
User offline. Last seen 4 years 16 weeks ago.

Excellent post. Thank you very much!!
sprint corporate

Beni
Title: NooBot
Joined: 08/04/2017
Posts:
BotPoints: 6
User offline. Last seen 5 years 9 weeks ago.

iphone 7 icloud unlock is available for iPhone 5,6 and 7. Perfect tool for safe data.