Why is pin 7 not putting out 3.3v

my imp works I think it maybe my code
pin 8 puts out 3.3v with this code:
hardware.pin8.configure(DIGITAL_OUT);
hardware.pin8.write(1);
but pin 7 only puts out 1v with this code:
hardware.pin7.configure(DIGITAL_OUT);
hardware.pin7.write(1);
how am I supposed to put out 3.3v from pin 7

class power_input extends InputPort
{
name = "Power On"
type = “number”

function set(value)
{
server.show(“Power On”);

    hardware.pin8.configure(DIGITAL_OUT);
    hardware.pin8.write(1);

}
}

class power_off extends InputPort
{
name = "Power Off"
type = “number”

function set(value)
{
server.show(“Power Off”);

    hardware.pin7.configure(DIGITAL_OUT);
    hardware.pin7.write(1);          

}
}
imp.configure(“CoffeeControlCenter”, [power_input(), power_off()], []);

what do you read if you set hardware.pin7.write(0); or hardware.pin8.write(0);

What are the pins attached to? Can you describe, or better still draw, the entire circuit? Is this still the coffee machine project, and if so have you taken note of the advice given in your other threads, to use a transistor to simulate the switch?

Peter

the are attached to the end of a momentary on and off switch
the transistor thing will not fix this problem pin 7 is float when it should not be. I just need to get some code that puts out 3.3v out of on pin only and 3.3v out of another pin only. The fact that this “impee” uses squirrel does not help

I noticed in your imp code that the pins are only driven high (1). Inside the classes there is nothing that sets them low?? If you set pin 8 to high then pin 7 to high, they are both still on.

class power_input extends InputPort { name = "Power On" type = "number" function set(value) { server.show("Power On"); hardware.pin7.write(0); hardware.pin8.write(1); } } class power_off extends InputPort { name = "Power Off" type = "number" function set(value) { server.show("Power Off"); hardware.pin8.write(0); hardware.pin7.write(1); } } imp.configure("CoffeeControlCenter", [power_input(), power_off()], []); hardware.pin8.configure(DIGITAL_OUT); hardware.pin7.configure(DIGITAL_OUT);

What happens if you try this?

Errrm, you’re connecting an output (on the imp) to a switch and expecting it to change the switch state? What else is connected to the switch?

Maybe draw the circuit diagram, take a picture, and post it here. Right now I’ve no idea what you’re trying to achieve, but I don’t think you’re doing it right…

Sounds like the way you have the switches hooked up, maybe pin 8 is feeding onto pin 7 that’s why it never goes to 0. I had this problem before…

I had to use a 2.2k resistor from each pin to ground and I used a diode before the wire connecting to the switches and it works now. thank you

this is my code
class power_input extends InputPort
{
name = "Power On"
type = “number”

function set(value)
{
// update the display
server.show(“Power On”);
hardware.pin8.configure(DIGITAL_OUT);
hardware.pin8.write(1);
imp.sleep(2);
hardware.pin8.configure(DIGITAL_OUT);
hardware.pin8.write(0);
}
}

class power_off extends InputPort
{
name = "Power Off"
type = “number”

function set(value)
{
// update display
server.show(“Power Off”);

    hardware.pin7.configure(DIGITAL_OUT);
    hardware.pin7.write(1);
    imp.sleep(2);
    hardware.pin7.configure(DIGITAL_OUT);
    hardware.pin7.write(0);         

}
}
// Register with the server , passing our two inputs as an array

imp.configure(“CoffeeControlCenter”, [power_input(), power_off()], []);