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:
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
void setup(){
gb.begin();
}
void loop(){
if(gb.update()){
gb.display.println("Hello World!");
}
}