setting a pin value to high when a button is pressed

I am using an expansion board tm1638 and I have the following code below, now when I press the first button on the expansion board the LED on the expansion board lights up and when I look at the serial print report, it does print test = whenever I press it however, I have attached a wire to the ground port the pin D1 and a resistor and the LED on my bread board doesnt turn on!, however, I left the led plugged in and ran the example blink script on Arduino and the LED lit up via the D1 pin so why cant I set the voltage to high when I press the button on the expansion board?

pinMode(D1, OUTPUT);

if (module.getButtons() == 0b00000001)
digitalWrite(D1, HIGH);
Serial.print("test = ");
delay (1000);
digitalWrite(D1, LOW);


You need to post ALL of your code, in code tags, and a link to the expansion board, and a schematic showing how things are wired.