Programming Help

15 replies [Last post]
Brandon
Title: NooBot
Joined: 11/01/2013
Posts:
BotPoints: 124
User offline. Last seen 3 years 41 weeks ago.

Im new to robotics and I don't know the different programming styles or how to program more advanced stuff. The only thing I do know is how to make the robot go forward and spin. HELP

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 30 weeks ago.

Chances are you probably work in C. There are a large number of more advanced things you can do with that language, but many of them require you to know how to program well. I would advise trying a C tutorial to learn more about the language and then applying some of what you learn to botball(a line following program with pid like control is a good test I've found).
I personally prefer C++, but it is not officially supported by KIPR and doesn't have the best documentation because of that. I found the easiest way to work with it was to learn the language and then read through the headers and sometimes the source files on github to figure out what things did.

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 3 years 43 weeks ago.

Ruler, C++ is my language of preference too. I program my games in C++ and not C for no reasons, lol. I don't know why I like C++, I know the compiler is quite different and the object orientation makes the worlds difference. Anyway, you might want to start of by learning how to manipulate variables and learning the different kinds of variables. Next, you would need to learn strings and finally, Boleen. If you like programming and you decide to stick with it, learning program flow and arrays and pointers and then I would get off topic and learn how to apply it via real world applications. For me, personally, I did game logic and programming via c++. After doing that, it helped my understanding of programming so much more.

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 30 weeks ago.

I personally think you should regard the basic types as int, float, bool(if in c++) with unsigned/long ass modifiers. Pointers should also be included, but they are a little more complex so they should be learned after you understand basic control flow and understand the other variable types.
In C you have to include an extra file, stdbool.h, to have a bool type. You have an extremely different method of string handling for C and C++ as C requires char pointers while C++ has a nice built in class called std::string.

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 3 years 43 weeks ago.

I stated how I learned the language. Personally, I didn't find the language to be hard at all. Maybe you have a different way of learning it.

Ben jamin'
Ben jamin''s picture
Title: NooBot
Joined: 10/29/2013
Posts:
BotPoints: 151
User offline. Last seen 4 years 3 weeks ago.

Yeah, don't completely understand programming either. I started looking up C language lesson on YouTube. I would recommend looking at lessons on your language. It is hard to learn program (Just my experience) and I still have a long way until I will I completely understand C. I just be looking up lessons or asking team members who understand programming.

~Ben Jamin'

Brandon
Title: NooBot
Joined: 11/01/2013
Posts:
BotPoints: 124
User offline. Last seen 3 years 41 weeks ago.

Ok thanks for the suggestion

Brandon
Title: NooBot
Joined: 11/01/2013
Posts:
BotPoints: 124
User offline. Last seen 3 years 41 weeks ago.

Ok thanks for the suggestion

Jesus Arzapalo
Title: NooBot
Joined: 10/23/2013
Posts:
BotPoints: 82
User offline. Last seen 1 year 22 weeks ago.

Yes I don't understand it so well but I started looking up tutorials and you can find some really great information online. Use the internet to your advantage.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 43 weeks ago.

@JArzapalo: Now this is a good response. I agree with you JArzapalo.

Also, for those of you who are in my class, I am planning on next week to present my powerpoint about the Botball programming language. However, it is not just the programming language, but also talking about the simulator, this Botball Community website, compiling issues, etc. For those of you who want a copy of this powerpoint when I am done, go to my other thread.

Thank you!

AmandaPanda
AmandaPanda's picture
Title: NooBot
Joined: 11/18/2013
Posts:
BotPoints: 144
User offline. Last seen 3 years 1 week ago.

Yeah, I know Create, but not how the number relate to how far, I know msleep means milliseconds :

create_connect();
msleep(2000);
create_drive_straight(200);
msleep(2000);
create_spin(200);
msleep(2000);
create_disconnect();

And some servo programming.

enable_servos();

Still kind of confused on the other part... set_servo_position(0,200)

??? Not sure on the last part.. I know it goes port... then I am not sure.

I want to learn about all the crazy color sorting stuff and everything else like that.

Amanda
PDCMS