Close

Playing around with IS31FL7X

davedarkodavedarko wrote 07/02/2017 at 17:37 • 2 min read • Like

Trying to make [this] work with the Arduino IDE on a Wemos D1 Mini. The additional capacitor got loose, so that there were fluctuations in one row. One row seems to be dead now, after I tried to resolder the QFN chip with my soldering iron. Instead of fiddeling around with that anymore, I finally got around to fix my hot air station. One of the 230V cables was crimped wrong, there was still some isolation where there should have been the blank cable, I wonder why it ever worked at first. There's a DIP Atmega8L inside - funky.

#include <Wire.h>
byte address = 0x50;
void setup() {  
  Wire.begin();
  activate();
}
void loop() {
  ledPWM(255);  
  delay(1000);
  ledPWM(0);
  delay(1000);
}
void ledPWM(byte b)
{
  // Wire.write(byte(0x00));
  for (byte i=0; i<98; i++)
  {
    writeEnable(byte(0x01));
    Wire.beginTransmission(address);
    Wire.write(i*2);
    Wire.write(b);
    Wire.endTransmission();
  }  
}
void turnOnLeds()
{
  writeEnable(byte(0x00));
  Wire.beginTransmission(address);
  Wire.write(byte(0x00));
  for (byte i=0; i<12; i++)
  {
    Wire.write(byte(0x55));
    Wire.write(byte(0x15));
  }
  Wire.endTransmission();
}
void releaseRegister()
{
  Wire.beginTransmission(address);
  Wire.write(byte(0xfe));  // send command 
  Wire.write(byte(0xc5));  // send page zero
  Wire.endTransmission();
}
void writeEnable(byte page)
{ 
  releaseRegister();
  Wire.beginTransmission(address);
  Wire.write(byte(0xfd));  // send command 
  Wire.write(page);  // send page zero
  Wire.endTransmission();
}
void activate()
{
  writeEnable(byte(0x03));
  Wire.beginTransmission(address);
  Wire.write(byte(0x00));  // Configuration Register
  Wire.write(byte(0x01));  // Set SSD = 1
  Wire.endTransmission();
  writeEnable(byte(0x03));
  Wire.beginTransmission(address);
  Wire.write(byte(0x01));  // Global Current Control
  Wire.write(byte(0x30));  // set to 127
  Wire.endTransmission();
  turnOnLeds();
}

Like

Discussions