P1 terminal board pins wont pull LOW

I purchased a P1 terminal breakout board from Controleverything.com, first flashing it with my code for a project I’m working on, I received no data out of the pins so I flashed a basic program just to test the pins:

int test = D0;

void setup() {
pinMode(test,INPUT_PULLDOWN);
}

void loop() {
if (digitalRead(test) == HIGH);
    RGB.control(true);
    RGB.color(0,0,255);
    delay(5000);
    RGB.control(false);
}

it appears all digital pins are high, as soon as the board finished flashing and connected to the cloud, the onboard LED went blue and stayed that way, never turning off. Any ideas?

I’ve added a 5 second delay at the end of the loop, so it stays blue for 5 seconds, then breathes cyan for 5 seconds, then back to blue.

Hi @Mjones

First off, I did not know that ControlEverything.com was making a P1 terminal board–they do make one for Photon which is P0. The P0 and P1 modules use different physical pins for “D0” so that might be something to check.

Also if you do have a P1, you must tell whatever compiler you are using to compile for a P1 since things like the pins used are different.

Finally I will ping @IOTrav here to see if he can help.

It is a P1, its a prototype board, limited run. Also, I’m using web IDE for compiling.

So in the web IDE you must select your claimed P1 device on “targets” side menu by clicking the little circle and crosshairs icon on the left. If the web IDE thinks your device is a Photon, it won’t compile correctly for the IO changes.

If you have done that, I suggest you get in touch with control everything since they control the pinout.

You might also want to try a pin other than D0, such as D7, since that is used for i2c which control everything uses for their modules and might have a pull up on it. The internal pull-down will not typically override an external pull-up. In fact all the pins could have pull-ups depending on how they designed the board, so I would pull D7 to GND and try that code.

1 Like

I rewrote the code for all digital pins, D0-D7, and even tried RX and TX, since the docs say they can be used as GPIO, all with the same result. I’ll check with @IOTrav, to see if there is a fix.

1 Like

@Mjones, has your rewritten code still this semi-colon after the if() statement?

That’s most likely your problem

void loop() {
if (digitalRead(test) == HIGH); // <-- this no-op will only be executed when the pin is HIGH
    RGB.control(true);          // but all this will ALWAYS be executed - this is C not Python where indentation makes a difference
    RGB.color(0,0,255);
    delay(5000);
    RGB.control(false);
}

You probably wanted to write this

void loop() {
  if (digitalRead(test) == HIGH) {
    RGB.control(true);
    RGB.color(0,0,255);
    delay(5000);
    RGB.control(false);
  }
}

So I’d guess this is not matter for @IOTrav, but for your own code :wink:

2 Likes

I’ll check it to see, can’t believe I missed that! Thanks @ScruffR

@ScruffR I don’t want to post my code for my project here, could I send it to you to see if I’m doing something wrong for a P1 compared to a Photon?

Hey @Mjones

There are a pair of jumpers on the board which pull D0 and D1 high. These are there to pull the pins high for I2C port usage. If you remove those jumpers the pins will float(hardware wise) so you can set them low in firmware. Sorry for the confusion on that.

3 Likes

You can PM me your code if your problem still exists