Tutorials are iffy...

Libraries, utilities, bootloaders...

Tutorials are iffy...

Postby HeroesNeverQuit » Sun Apr 13, 2014 3:59 pm

So I have 0 programming knowledge at all. The tutorials just don't actually teach anything though.

I will take the basic hello world one for an example.

//imports the SPI library (needed to communicate with Gamebuino's screen)
#include <SPI.h>
//importe the Gamebuino library
#include <Gamebuino.h>

That to me anyways is completely meaningless just letters. Where it says //Imports the SPI library do you just put in // or do you put in //imports. Regardless of which one you input where do you go to input it? I just think the tutorials are not written well enough for someone clueless like me to be able to use them. Even just if I was going to use the exact thing written and not add anything else in just follow the directions. I don't think I would be able too.

I will use these 3 lines as an example:

//imports the SPI library (needed to communicate with Gamebuino's screen)
//creates a Gamebuino object named gb
// the setup routine runs once when Gamebuino starts up

In line one its like you are saying // is a command and imports the SPI library. In line two its as if you are using // to indicate that it creates a gamebuino object. In line 3 its as if // is not a command at all and your using it to differentiate lines of code and info. Its just altogether very confusing.

Then you have the lines starting with # which once again Im not sure if they are code or what exactly. Im just altogether a bit confused. I am really excited about the gamebuino and I want to learn to code for it but with these tutorials I am just not sure I could learn anything.
HeroesNeverQuit
 
Posts: 5
Joined: Sun Apr 13, 2014 3:38 pm

Re: Tutorials are iffy...

Postby rodot » Sun Apr 13, 2014 7:23 pm

Hello HeroesNeverQuit, and welcome to the forum.

You're talking about commented examples, which are not really tutorials. There is no tutorial about the basics of C/C++/Arduino syntax yet. I think you should take a look at the the "Arduino - Foundations" page first : http://arduino.cc/en/Tutorial/Foundations. It "contains explanations of some of the elements of the Arduino hardware and software and the concepts behind them". As Gamebuino is based on Arduino, syntax is exactly the same.

Once you've read that, you'll understand that everything after // on a line is a comment. It doesn't affect the program, it's just here to help people understand.

I hope that helped, and good luck learning how to program :)
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Tutorials are iffy...

Postby phi » Sun Apr 13, 2014 7:58 pm

Lines with // at the beginning are comments. These are only for your understanding - they are ignored by the compiler and are displayed in grey in the arduino editor.
The comments tell you what the code below does so a well commented code is great for beginners.
You can delete all lines with a // at the beginning and the code will still work.

Lines with a # are preprocessor directives and are examined before the actual compilation.
In this case some external libraries are needed and hence included in the header.

You should definitely check out some C++ tutorials before you begin programming for the Gamebuino.
It's not that hard - you just need some time to get used to it.

Here is the code without the comments and without the frame counter. It is the bare minimum to display the words "Hello World" on the screen.

Code: Select all
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

void setup(){
  gb.begin();
}

void loop(){
  if(gb.update()){
    gb.display.println("Hello World!");
  }
}
User avatar
phi
 
Posts: 50
Joined: Sun Mar 23, 2014 1:48 pm
Location: Germany

Re: Tutorials are iffy...

Postby adekto » Mon Apr 14, 2014 12:13 am

i think u need a bit of basic programing knowledge,or at least understand some of the basic principles
like said before // is a comment everything behind // gets ignored by the compiler (the program that converts ur c code to machine code)
just a heads up theres also this /* multi line comment */ this one spans over more then one lines
these things can be very usefull if u put code that u have invisible to the compiler to see if that causes a bug u have

now the real code that is important for gamebuino is #include <SPI.h> and #include <Gamebuino.h>
to put it simple u need these to interface with the gamebuino hardware (if u look at the comments u see what they do specifically)

if u really dont understand this i think its better to just pick up a programing basics book and start from there
User avatar
adekto
 
Posts: 448
Joined: Tue Feb 25, 2014 9:47 pm
Location: belgium

Re: Tutorials are iffy...

Postby HeroesNeverQuit » Mon Apr 14, 2014 3:10 am

Ah ok that makes wayyyy more sense now. I just had no idea what I was looking at XD.

I probably will pick up a basic coding book regardless just to help myself out.

So for the gamebuino it has this line #include <Gamebuino.h>. Since I am assuming that is device specific will the gamebuino come with a little book that tells us all the device specific codes?
HeroesNeverQuit
 
Posts: 5
Joined: Sun Apr 13, 2014 3:38 pm

Re: Tutorials are iffy...

Postby rodot » Mon Apr 14, 2014 6:11 am

All the device specific code will be in the Reference : http://gamebuino.com/wiki/index.php?title=Reference
But it's not documented yet, as the code is still changing quiet frequently.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Tutorials are iffy...

Postby HeroesNeverQuit » Mon Apr 14, 2014 12:47 pm

Ah ok. Out of curiosity will people be able to sell games online for the system or?
HeroesNeverQuit
 
Posts: 5
Joined: Sun Apr 13, 2014 3:38 pm

Re: Tutorials are iffy...

Postby rodot » Mon Apr 14, 2014 12:52 pm

Yeah you could sell games, but that would be absurd and totally against Gamebuino's open-source mindset. This community is about sharing and learning from each other's work, not profit.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Tutorials are iffy...

Postby HeroesNeverQuit » Mon Apr 14, 2014 2:51 pm

So if someone works for weeks to create something amazing he should give it away for free?

If I recall you even stated you would not give away the gamebuino PCB layout as you would not want others to use it to make there own device. How is that any different from selling a game?
HeroesNeverQuit
 
Posts: 5
Joined: Sun Apr 13, 2014 3:38 pm

Re: Tutorials are iffy...

Postby adekto » Mon Apr 14, 2014 3:13 pm

i see your point of argument but its different in a sense ur dealing with hardware
the schematic u can find on the site but the actual layout would make it to easy for firms like sparkfun for example to capitalize on it and ask 2 times the price for it just to have it in red and there logo on it (case not included)

im also looking at pricing myself but i think id better do something like a physical boxed copy with a actual manual and player guide or something, or the idea of donationware or game bundle

if we are doing a store i think its going to be heavily moderated so ur game works perfectly and has at least something like a demo

ps sorry rodot not everything is open-source. also open-source doesn't always mean free
User avatar
adekto
 
Posts: 448
Joined: Tue Feb 25, 2014 9:47 pm
Location: belgium

Next

Return to Software Development

Who is online

Users browsing this forum: No registered users and 44 guests

cron