Issues with I2C on NeoKey 1x4 QT

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
SmallBagsOfCoins
 
Posts: 2
Joined: Sun Apr 16, 2023 2:53 pm

Issues with I2C on NeoKey 1x4 QT

Post by SmallBagsOfCoins »

Hello, (I hope this is the right forum, sorry if it isn't.)
Currently, I am working on a group project for school, which involves the NeoKey 1x4. Currently, we seem to be having some troubles with the I2C on the device as it is throwing errors with the example file (I have tried addresses 0x30-0x3F). Currently, we are thinking that the I2C chip might be defective. Here's why:

Here is how it is set up:
image3.jpeg
image3.jpeg (100.99 KiB) Viewed 505 times
image1 (7).jpeg
image1 (7).jpeg (181.29 KiB) Viewed 505 times
C is connected to SCL
D is connected to SDA
Vin is connected to 5V (have also tried 3.3V)
- is connected to Ground.

Here is the code I am currently attempting to run (the example file):

Code: Select all

#include "Adafruit_NeoKey_1x4.h"
#include "seesaw_neopixel.h"

Adafruit_NeoKey_1x4 neokey;

void setup() {
  Serial.begin(115200);
  while (! Serial) delay(10);
   
  if (! neokey.begin(0x30)) {
    Serial.println("Could not start NeoKey, check wiring?");
    while(1) delay(10);
  }
  
  Serial.println("NeoKey started!");

  for (uint16_t i=0; i<neokey.pixels.numPixels(); i++) {
    neokey.pixels.setPixelColor(i, Wheel(map(i, 0, neokey.pixels.numPixels(), 0, 255)));
    neokey.pixels.show();
    delay(50);
  }
  for (uint16_t i=0; i<neokey.pixels.numPixels(); i++) {
    neokey.pixels.setPixelColor(i, 0x000000);
    neokey.pixels.show();
    delay(50);
  }
}

uint8_t j=0;  // this variable tracks the colors of the LEDs cycle.

void loop() {
  uint8_t buttons = neokey.read();

  
  for (int i=0; i< neokey.pixels.numPixels(); i++) {
    neokey.pixels.setPixelColor(i, Wheel(((i * 256 / neokey.pixels.numPixels()) + j) & 255));
  }  
  
  if (buttons & (1<<0)) {
    Serial.println("Button A");
  } else {
    neokey.pixels.setPixelColor(0, 0);
  }

  if (buttons & (1<<1)) {
    Serial.println("Button B");
  } else {
    neokey.pixels.setPixelColor(1, 0);
  }
  
  if (buttons & (1<<2)) {
    Serial.println("Button C");
  } else {
    neokey.pixels.setPixelColor(2, 0);
  }

  if (buttons & (1<<3)) {
    Serial.println("Button D");
  } else {
    neokey.pixels.setPixelColor(3, 0);
  }  

  neokey.pixels.show();
  
  delay(10);    // don't print too fast
  j++;          // make colors cycle
}



/******************************************/

// Input a value 0 to 255 to get a color value.
// The colors are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return seesaw_NeoPixel::Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return seesaw_NeoPixel::Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return seesaw_NeoPixel::Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  return 0;
}
Upon running this I am currently being provided with this error:
NeoKey_Swirl_error1.jpg
NeoKey_Swirl_error1.jpg (29.55 KiB) Viewed 505 times
I have also tried running an I2C scanner to search for devices:

Code: Select all

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
 
#include <Wire.h>
 
 
void setup()
{
  Wire.begin();
 
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
 
 
void loop()
{
  byte error, address;
  int nDevices;
 
  Serial.println("Scanning...");
 
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
 
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
 
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
 
  delay(500);           // wait 5 seconds for next scan
}
This provides me with no devices found as well.

My group has also told me that they have attempted to find the I2C via an oscilloscope as well, but were not met with success on that end.

If anyone is able to let me know if it is faulty and will need a replacement, or if I am doing something wrong that would be very helpful!

Also to support- I have the order number with me, I just didn't want to put it within the thread.

User avatar
dastels
 
Posts: 15659
Joined: Tue Oct 20, 2015 3:22 pm

Re: Issues with I2C on NeoKey 1x4 QT

Post by dastels »

The Mega is a 5v device and so you need to power the NeoKey with 5v.

You haven't shorted any of the address jumpers so it will be at 0x30.

When connected and the Mega running, is the green "on" LED lit?

Please show the soldering on the header pins.

Dave

User avatar
SmallBagsOfCoins
 
Posts: 2
Joined: Sun Apr 16, 2023 2:53 pm

Re: Issues with I2C on NeoKey 1x4 QT

Post by SmallBagsOfCoins »

Hello, thanks for the reply! Yes, the green LED lights up when connected and running, but it doesn't communicate with the board whatsoever.

Here is an image of the soldering:
image0 (23).jpeg
image0 (23).jpeg (152 KiB) Viewed 488 times

User avatar
dastels
 
Posts: 15659
Joined: Tue Oct 20, 2015 3:22 pm

Re: Issues with I2C on NeoKey 1x4 QT

Post by dastels »

OK, so it's getting power. And the soldering looks fine.

Please email [email protected] with a link to this thread, your order number, and request the replacement of one NeoKey 1x4 Stemma-QT.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”