# Enviro Plus GPIO

**URL:** <https://forums.pimoroni.com/t/enviro-plus-gpio/11671>\
**Category:** Support\
**Created:** [September 20, 2019, 1:08am UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671 "2019-09-20T01:08:16Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 2:26pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/21 "2019-09-25T14:26:39Z")

</div>

What I mean by on top is, if the enviro is facing you, right side up, the Pi will be extending out from the top edge. Not the bottom edge. It will be up in the air versus flat on the desk etc. It will be upside down too. Component side down.  
The header you want is male right angle  
[https://shop.pimoroni.com/products/male-40-pin-2x20-hat-header?variant=14883873735](https://shop.pimoroni.com/products/male-40-pin-2x20-hat-header?variant=14883873735)

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 25, 2019, 2:40pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/22 "2019-09-25T14:40:13Z")

</div>

Right. It would be an awkward config. I’m going with the ribbon cable.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 2:56pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/23 "2019-09-25T14:56:07Z")

</div>

Yeah, it would be an awkward setup. It’s not how I had envisioned it when I posted that suggestion.

---

<div class="post-metadata">

**Author:** ![nophead](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/nophead/32/5827_2.png) [@nophead](https://forums.pimoroni.com/u/nophead)\
**Post date:** [September 25, 2019, 3:21pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/24 "2019-09-25T15:21:15Z")

</div>

Yes mine is upside down ATM but as I am not using the display so it doesn’t matter. When I make a case I will mount the RPI in the top.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 3:28pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/25 "2019-09-25T15:28:03Z")

</div>

There is likely a rotate option to flip it 180. Assuming you don’t mind the artwork being upside down,  
I see a rotation option mentioned here,

> **[pimoroni/st7735-python](https://github.com/pimoroni/st7735-python)**
>
> Python library to control an ST7735 TFT LCD display. Allows simple drawing on the display without installing a kernel module. - pimoroni/st7735-python

---

<div class="post-metadata">

**Author:** ![nophead](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/nophead/32/5827_2.png) [@nophead](https://forums.pimoroni.com/u/nophead)\
**Post date:** [September 25, 2019, 3:31pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/26 "2019-09-25T15:31:37Z")

</div>

Since I have a fan blowing air past the board I think it will be fine with RPI at the top.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 3:38pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/27 "2019-09-25T15:38:23Z")

</div>

My Sense Hat is behind a black diffuser, all that’s visible is the text being displayed. You’d have to own one to know by looking at it that its upside down. It has a rotate option for the LED matrix.  
It made programming the joystick interesting though. Up was now down, left is right etc.

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 25, 2019, 4:47pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/28 "2019-09-25T16:47:07Z")

</div>

There must be a way of programming the joystick keys to reorient them. I’m going to go for an extension cable and figure out a case later. I want to see how accurate the Envirohat+ is.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 5:29pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/29 "2019-09-25T17:29:21Z")

</div>

I just adjusted my code so what I wanted to happen when the stick moves up, happens when it moves down etc.

```auto
# is really stick down
def pushed_up(event):
    if event.action == ACTION_PRESSED:
       sense.low_light = True
        
# is really stick up
def pushed_down(event):
    if event.action == ACTION_PRESSED:
       sense.low_light = False

```

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 25, 2019, 5:57pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/30 "2019-09-25T17:57:01Z")

</div>

Brute force always works. :)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 25, 2019, 6:51pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/31 "2019-09-25T18:51:44Z")

</div>

They call it a joystick but its actually just a 5 way switch. Up, down, left, right and center. It did come in handy though, saves me having to connect a keyboard or mouse to do something. Or wire up my own buttons etc.

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 25, 2019, 8:50pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/32 "2019-09-25T20:50:43Z")

</div>

I have a tiny one with resistor pots that I scavenged years ago but haven’t found a use for it yet.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 26, 2019, 9:06am UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/33 "2019-09-26T09:06:03Z")

</div>

I have a big PC one in a box some place. It has the old Game port connector on it. Same deal it has potentiometers inside. I could take the circuit board out and use it with a Pi or Arduino. You just read the pots with an ADC. Thats got me thinking. I have a couple of Pi Rovers sitting on the shelf waiting for a controller. If I can stuff a Pi Zero and a battery in the bottom it may be usable. Assuming I can link the two Pi Zero’s via Bluetooth. And the joystick still works.

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 26, 2019, 1:37pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/34 "2019-09-26T13:37:28Z")

</div>

That sounds like it would work. What would you do with the joystick? I’m still getting used to the Pi and doing programming again at the command level. I did a bit of scripting back when but I’m still getting used to the terminology used with Raspian.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 26, 2019, 2:07pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/35 "2019-09-26T14:07:17Z")

</div>

I’d use it to control the rover via Bluetooth connection. Right now I just use a mini wireless keyboard.

---

<div class="post-metadata">

**Author:** ![Crowbot](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/crowbot/32/5888_2.png) [@Crowbot](https://forums.pimoroni.com/u/Crowbot)\
**Post date:** [September 26, 2019, 4:03pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/36 "2019-09-26T16:03:33Z")

</div>

I got the extender cable and now the temperature readings are spot on with my room thermometer. Recommended.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [September 26, 2019, 5:06pm UTC](https://forums.pimoroni.com/t/enviro-plus-gpio/11671/37 "2019-09-26T17:06:42Z")

</div>

Thats good to hear, enjoy. =)

[Previous page](https://forums.pimoroni.com/t/enviro-plus-gpio/11671.md?page=1)
