I got an Arduino Uno to play around with, and started to actually dive in. During a program that I am writing for a friend, it suddenly stopped outputting to the serial monitor. When I comment out the part I added (the for loop for changing the names), it still doesn't respond.
#include <TrueRandom.h>
#include <EEPROM.h>
#define numPokemon 151
String nameArray[] = {"MISSINGNO","Bulbasaur","Ivysaur","Venusaur","Charmander","Charmeleon","Charizard","Squirtle",
"Wartortle","Blastoise","Caterpie","Metapod","Butterfree","Weedle","Kakuna","Beedrill","Pidgey","Pidgeotto",
"Pidgeot","Rattata","Raticate","Spearow","Fearow","Ekans","Arbok","Pikachu","Raichu","Sandshrew","Sandslash",
"Nidoran♀","Nidorina","Nidoqueen","Nidoran♂","Nidorino","Nidoking","Clefairy","Clefable","Vulpix","Ninetales","Jigglypuff",
"Wigglytuff","Zubat","Golbat","Oddish","Gloom","Vileplume","Paras","Parasect","Venonat","Venomoth","Diglett","Dugtrio","Meowth",
"Persian","Psyduck","Golduck","Mankey","Primeape","Growlithe","Arcanine","Poliwag","Poliwhirl","Poliwrath","Abra","Kadabra","Alakazam",
"Machop","Machoke","Machamp","Bellsprout","Weepinbell","Victreebel","Tentacool","Tentacruel","Geodude","Graveler","Golem","Ponyta","Rapidash",
"Slowpoke","Slowbro","Magnemite","Magneton","Farfetch`d","Doduo","Dodrio","Seel","Dewgong","Grimer","Muk","Shellder","Cloyster","Gastly","Haunter",
"Gengar","Onix","Drowzee","Hypno","Krabby","Kingler","Voltorb","Electrode","Exeggcute","Exeggutor","Cubone","Marowak","Hitmonlee","Hitmonchan","Lickitung",
"Koffing","Weezing","Rhyhorn","Rhydon","Chansey","Tangela","Kangaskhan","Horsea","Seadra","Goldeen","Seaking","Staryu","Starmie","Mr. Mime","Scyther","Jynx",
"Electabuzz","Magmar","Pinsir","Tauros","Magikarp","Gyarados","Lapras","Ditto","Eevee","Vaporeon","Jolteon","Flareon","Porygon","Omanyte","Omastar","Kabuto","Kabutops",
"Aerodactyl","Snorlax","Articuno","Zapdos","Moltres","Dratini","Dragonair","Dragonite","Mewtwo","Mew",
};
int a = 0;
int b = 0;
int value;
String pokemonName;
int currentID = TrueRandom.random(1,numPokemon+1);
// a = CurrentID
void setup(){
Serial.begin(9600);
if (EEPROM.read(a)!=0){
currentID = EEPROM.read(a);
Serial.print("The Stored ID is ");
Serial.println(EEPROM.read(a));
Serial.println("Stored = true");
}else{
value = EEPROM.read(a);
Serial.println(value);
EEPROM.write(a,currentID);
value = EEPROM.read(a);
Serial.println(value);
Serial.println("Stored = false");
}
for (int i = 0 ; i < 152 ; i++){
if (currentID = i){
pokemonName = nameArray[i];
Serial.print(pokemonName);
break;
}
}
//nameChange(currentID);
//Serial.println(pokemonName);
}
void loop(){
}
void nameChange(int currentID){
for (int i = 0 ; i < 152 ; i++){
if (currentID = i){
pokemonName = nameArray[i];
break;
}
}
}
What is the problem with this code?