LED state machine

This example is for Wiring version 1.0 build 0100+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.

HelloHashMap by BREVIG http://alexanderbrevig.com

Demonstrate the usage of a HashMap This HashMap will pair a char* string to an integer and it has the capacity to hold three pairs

#include <HashMap.h>

CreateHashMap(hashMap, char*, int, 3); //create hashMap that pairs char* to int and can hold 3 pairs

void setup()
  //add and store keys and values
  hashMap["newKey"] = 12;
  hashMap["otherKey"] = 13;
  //check if overflow (there should not be any danger yet)
  Serial.print("Will the hashMap overflow now [after 2 assigns] ?: ");
  hashMap["lastKey"] = 14;
  //check if overflow (this should be true, as we have added 3 of 3 pairs)
  Serial.print("Will the hashMap overflow now [after 3 assigns] ?: ");
  //it will overflow, but this won't affect the code.
  hashMap["test"] = 15;

  //change the value of newKey
  Serial.print("The old value of newKey: ");
  Serial.print("The new value of newKey (after hashMap['newKey']++): ");

  //remove a key from the hashMap
  //this should work as there is now an availabel spot in the hashMap
  hashMap["test"] = 15;


void loop() {}

void printHashMap() 
  for (int i=0; i<hashMap.size(); i++) 
    Serial.print("Key: ");
    Serial.print(" Value: ");