Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

LED Issues
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LED Issues

by LitingWolf on Thu Jul 23, 2020 10:53 am

So i need help i turn off one led and turn one led on as you can see in the script but multiple LED turns on and if i turn on a diffrent led other leds turns on or if i turn off an led it turns other leds on like the leds are connected some way with if pin 0 turns off then turn pin (4578) on im so confused someone please help im thinking its the breadboard issue but i have 4 breadboards and its happening the them all
Code: Select all | TOGGLE FULL SIZE
#include "RTClib.h"
#include <Adafruit_MCP23017.h>
#define NUM_ONES_LEDS 4

Adafruit_MCP23017 mcp3;
void setup() {
  // put your setup code here, to run once:
 //mcp
  mcp3.begin(B011);
  mcp3.pinMode(0, OUTPUT);//JAN
  mcp3.pinMode(1, OUTPUT);//FEB
  mcp3.pinMode(2, OUTPUT);//MAR
  mcp3.pinMode(3, OUTPUT);//APR
  mcp3.pinMode(4, OUTPUT);//MAY
  mcp3.pinMode(5, OUTPUT);//JUN
  mcp3.pinMode(6, OUTPUT);//JUL
  mcp3.pinMode(7, OUTPUT);//AUG
  mcp3.pinMode(8, OUTPUT);//SEP
  mcp3.pinMode(9, OUTPUT);//OCT
  mcp3.pinMode(10, OUTPUT);//NOV
  mcp3.pinMode(11, OUTPUT);//DEC
  mcp3.pinMode(12, OUTPUT);//
  mcp3.pinMode(13, OUTPUT);//
  mcp3.pinMode(14, OUTPUT);//
  mcp3.pinMode(15, OUTPUT);//


}

void loop() {
    mcp3.digitalWrite(2, HIGH);
    mcp3.digitalWrite(1, LOW);
}

LitingWolf
 
Posts: 37
Joined: Thu Jan 02, 2020 3:03 pm

Re: LED Issues

by dastels on Thu Jul 23, 2020 11:12 am

How are the LEDs wired?

Dave

dastels
 
Posts: 3549
Joined: Tue Oct 20, 2015 3:22 pm

Re: LED Issues

by adafruit_support_bill on Thu Jul 23, 2020 11:17 am

Please post some photos showing how you have everything hooked up.

adafruit_support_bill
 
Posts: 78774
Joined: Sat Feb 07, 2009 10:11 am

Re: LED Issues

by LitingWolf on Thu Jul 23, 2020 11:27 am

I tried off my phone but the picture is too big and its one pin to led and the other pin of led is to ground nothing is connected to the led except pin of mcp and ground on there own row

LitingWolf
 
Posts: 37
Joined: Thu Jan 02, 2020 3:03 pm

Re: LED Issues

by adafruit_support_bill on Thu Jul 23, 2020 12:01 pm

There are lots of on-line photo resizing apps on the web. There is a 1 meg limit for posting here to the forums.

adafruit_support_bill
 
Posts: 78774
Joined: Sat Feb 07, 2009 10:11 am

Re: LED Issues

by LitingWolf on Thu Jul 23, 2020 12:12 pm

Picture unfortunately im not at home to retake but when i do ill get abetter shot
Attachments
JPEG_20200722_155043.jpg
JPEG_20200722_155043.jpg (124.78 KiB) Viewed 22 times

LitingWolf
 
Posts: 37
Joined: Thu Jan 02, 2020 3:03 pm

Re: LED Issues

by dastels on Thu Jul 23, 2020 2:13 pm

So 23017 pin to resistor to LED to ground? Each one independently?

Dave

dastels
 
Posts: 3549
Joined: Tue Oct 20, 2015 3:22 pm

Re: LED Issues

by LitingWolf on Thu Jul 23, 2020 2:15 pm

Yes

LitingWolf
 
Posts: 37
Joined: Thu Jan 02, 2020 3:03 pm

Please be positive and constructive with your questions and comments.