I have no idea whats going on

The title says it all right? Not really sadly. Long story short I have a Digispark that I want to have listening out for a button press, and if the button has been pressed to turn on a LED. Then ignore any future button presses until a second button is pressed. when this second button is pressed it should turn the light off and start listening out for the first button again. At present, irregardless of Master being tied HIGH or LOW i will get the same response from pressing the Button. Which is to light LED as long as Button is being held.

Observably it appears to be running something like

loop() { if button = high digitalwrite led = on else digitalwrite = off end }

hopefully someone can help me.

http://pastebin.com/c6y3LKYD

if (button == HIGH)

= is assignment operator == comparison operator HIGH not 'high': C is case sensitive.

check the syntax of digitalWrite

if the above code is a pseudo code then ignore my above comments.

my appologies, i thought it would be clear that the quotes code was just pseudocode to get an idea accross. please see the linked pastebin code.

The formatting in the pastebin is horrible, can you please post it the thread, remember to use code tag.

#define buttonpin 1
#define masterpin 2
#define ledpin 0

void setup() {
  pinMode(buttonpin, INPUT);
  pinMode(masterpin, INPUT);
  pinMode(ledpin, OUTPUT);
}

void loop() {
    static bool ledState = false; // LED is off by default
    if ((digitalRead(buttonpin) == HIGH) && !ledState) { // 1 pressed & led is off
        digitalWrite(ledpin, HIGH);
        ledState = true;
    }
    if ((digitalRead(masterpin) == HIGH) && ledState) { // 2 pressed & led is on
        digitalWrite(ledpin, LOW);
        ledState = false;
    }
}

Hmm... Pastebin looked fine on this end, That better?

So loop loops over and over. If the pin reads high then the first if sets ledState true. That makes the second if true so it makes ledState false so that makes the first if true and it goes on and on as long as you hold the button. You need to look t the state change example if you want to react once per button press. Right now the ledState variable is pretty useless.

Probably this is what you need to do.

#define buttonpin 1
#define masterpin 2
#define ledpin 0

bool masterSelected;
void setup() {
  pinMode(buttonpin, INPUT);
  pinMode(masterpin, INPUT);
  pinMode(ledpin, OUTPUT);
  masterSelected = false;
}

void loop() {
  if ((digitalRead(masterpin) == HIGH) && masterSelected == false) {
    digitalWrite(ledpin, HIGH);
    masterSelected = true;
  }
  //second pin can switch off the LED if the Master already 
  //turned on the LED
  if ((digitalRead(buttonpin) == HIGH) && masterSelected == true) {
    digitalWrite(ledpin, LOW);
    masterSelected = false;
  }
}

I am not currently in my lab, nor will i be this week. But i appreciate the assistance and I will give this a shot and report back asap.

With this type of code, you don't want to do something if the button is pressed: you want to do something if the button has [u]changed[/u] from being not pressed to being pressed.

boolean isPressed = false;

void loop() {
  boolean wasPressed = isPressed;
  isPressed = (digitalRead(buttonPin) == LOW);

  if(!wasPressed && isPressed) {
    // the button has been pressed.
    // do something.
  }
}