Errors with ')' and ';'
Posted: Tue Dec 20, 2016 8:28 pm
Hiya! I'm quite new to this language, so my question may have a very simple answer, but I'm having trouble finding such an answer online. Is it possible that I could print my code here and have someone tell me what's up? I'm trying to make a very simple program (not really a game), and it really consists of about two controls and three values. However, when I try to print the integer values, it is always telling me it expects a ')' or a ';' at random spots in the line. Thanks for help ahead of time, and here is the code
- Code: Select all
//imports the SPI library (needed to communicate with Gamebuino's screen)
#include <SPI.h>
//importe the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;
//declare all the variables needed for the game :
int chain = 1;
int chance = 0;
int fchain = 1;
void setup() {
// put your setup code here, to run once:
// initialize the Gamebuino object
gb.begin();
// show the start menu
gb.titleScreen(F("Shiny Probability"));
//random values
pinMode(chain, OUTPUT);
if (chain <= 69)
chance = chain / 4096;
if (chain >= 70)
chance = chain / 1024;
if (chain >= 256)
chain = 1;
}
void loop() {
// put your main code here, to run repeatedly:
if (gb.update()) {
//prints Chain length on the screen
gb.display.println(F("Chain Length:")Serial.print(fchain))
gb.display.println(F("Chance of Shiny:")Serial.print(chance))
if (gb.buttons.pressed(BTN_A)) {
chain = chain + 1
}
if (gb.buttons.pressed(BTN_B)) {
chain = chain - 1
}
}
}