Hello!
On the board shown at https://www.adafruit.com/product/4471 I noticed the presence of both a 5v
and a 3v connector. Does this mean that the device will work in both situations? I ask because I'm primarily a user of TTL logic who runs at 5v and rarely do anything with items who use 3v which are usually on the Raspberry Pi systems.
New MCP221A question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- sj_remington
- Posts: 998
- Joined: Mon Jul 27, 2020 4:51 pm
Re: New MCP221A question
The MCP2221A will work with 5V and 3.3V logic. The latter is becoming the standard for MCUs, and is certainly not limited to RPi.
- doctorwho8
- Posts: 160
- Joined: Sat Aug 01, 2009 10:24 pm
Re: New MCP221A question
Hello!sj_remington wrote: ↑Mon Mar 27, 2023 11:20 pm The MCP2221A will work with 5V and 3.3V logic. The latter is becoming the standard for MCUs, and is certainly not limited to RPi.
Yes of course regarding other MCUs and probably a raft of regular Microprocessors, I chose the RPi because that fellow was my first exposure to systems running Linux who're making use of levels at 3.3v for example. My next problem will be to work out the Python or Micro Python code to run on the device, or to work with it.
- doctorwho8
- Posts: 160
- Joined: Sat Aug 01, 2009 10:24 pm
Re: New MCP221A question
Code: Select all
Hello!doctorwho8 wrote: ↑Mon Mar 27, 2023 11:43 pmHello!sj_remington wrote: ↑Mon Mar 27, 2023 11:20 pm The MCP2221A will work with 5V and 3.3V logic. The latter is becoming the standard for MCUs, and is certainly not limited to RPi.
Yes of course regarding other MCUs and probably a raft of regular Microprocessors, I chose the RPi because that fellow was my first exposure to systems running Linux who're making use of levels at 3.3v for example. My next problem will be to work out the Python or Micro Python code to run on the device, or to work with it.
Now this becomes the next one:
Code: Select all
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.G0)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
It's on that one that I decided to stop there for the moment.
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: New MCP221A question
If you want to use G1 instead of G0 then just need to change code to that:
If you want to use G1 *and* G0, then create two separate variables:
Code: Select all
led = digitalio.DigitalInOut(board.G1)
led.direction = digitalio.Direction.OUTPUT
Code: Select all
led1 = digitalio.DigitalInOut(board.G0)
led1.direction = digitalio.Direction.OUTPUT
led2 = digitalio.DigitalInOut(board.G1)
led2.direction = digitalio.Direction.OUTPUT
Please be positive and constructive with your questions and comments.