Thursday, March 28, 2019

Teensy 3.1 and SmartMatrix SD running 32x32 and 32x64 LED Matrix panels.

I purchased a Teensy 3.1 and Smart Matrix SD with 32x32 LED panel kit.  It is called "Pixelmatix SmartMatrix SD Shield KIT, Teensy 3.1, 32x32 RGB LED matrix 4mm pitch".  It had some bugs like the connector that goes to the LED panel, if installed on the Smart Matrix shield, would not fit the panel that came with the kit.  The power connector was in the way.  So as a solution I used a ribbon cable from the smart matrix to the LED panel.  I also added female headers so that the Teensy processor can be removed and used elsewhere.


Here is a video of it working.


This is a close up of the Teensy and SmartMatrix shield. Note that everything is on the top side of the board.
Now to fix the Teensy code to support the newer 64x32 LED panels.

Here is a video of the Teensy working with two 64x32 LED panels after being "Reset" with the code below.



This is the reset code.
// SMart Matrix Panel Reset Program
// For use with newer LED Panels
// Written 3/28/2019 by Bob Davis
int MaxLed = 256;

#define GPIO_PIN_CLK_TEENSY_PIN    14
#define GPIO_PIN_LATCH_TEENSY_PIN   3
#define GPIO_PIN_OE_TEENSY_PIN      4
#define GPIO_PIN_B0_TEENSY_PIN      6
#define GPIO_PIN_R0_TEENSY_PIN      2
#define GPIO_PIN_R1_TEENSY_PIN      21
#define GPIO_PIN_G0_TEENSY_PIN      5
#define GPIO_PIN_G1_TEENSY_PIN      7
#define GPIO_PIN_B1_TEENSY_PIN      20
#define ADDX_TEENSY_PIN_0   9
#define ADDX_TEENSY_PIN_1   10
#define ADDX_TEENSY_PIN_2   22
#define ADDX_TEENSY_PIN_3   23

int C12[16] = {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int C13[16] = {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0};

void setup() {
  // put your setup code here, to run once:
    pinMode(GPIO_PIN_CLK_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_LATCH_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_OE_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_B0_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_R0_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_R1_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_G0_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_G1_TEENSY_PIN, OUTPUT);
    pinMode(GPIO_PIN_B1_TEENSY_PIN, OUTPUT);
    pinMode(ADDX_TEENSY_PIN_0, OUTPUT);
    pinMode(ADDX_TEENSY_PIN_1, OUTPUT);
    pinMode(ADDX_TEENSY_PIN_2, OUTPUT);
    pinMode(ADDX_TEENSY_PIN_3, OUTPUT);
}

void loop() {
    // put your main code here, to run repeatedly:
    // Send Data to control register 11
    digitalWrite (GPIO_PIN_OE_TEENSY_PIN, HIGH); // Display reset
    digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
    digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
    for (int l=0; l<MaxLed; l++){
      int y=l%16;
      digitalWrite (GPIO_PIN_R0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_G0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_B0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_R1_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_G1_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_B1_TEENSY_PIN,LOW);
      if (C12[y]==1){
          digitalWrite (GPIO_PIN_R0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_G0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_B0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_R1_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_G1_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_B1_TEENSY_PIN,HIGH);
      }
      if (l>MaxLed-12){digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, HIGH);}
          else{digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, LOW);}
      digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, HIGH); 
      digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, LOW); 
    }
  digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
  digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
  // Send Data to control register 12
    for (int l=0; l<MaxLed; l++){
      int y=l%16;
      digitalWrite (GPIO_PIN_R0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_G0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_B0_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_R1_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_G1_TEENSY_PIN,LOW);
      digitalWrite (GPIO_PIN_B1_TEENSY_PIN,LOW);
      if (C13[y]==1){
          digitalWrite (GPIO_PIN_R0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_G0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_B0_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_R1_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_G1_TEENSY_PIN,HIGH);
          digitalWrite (GPIO_PIN_B1_TEENSY_PIN,HIGH);
      }   
      if (l>MaxLed-13){digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, HIGH);}
          else{digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, LOW);}
      digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, HIGH); 
      digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, LOW); 
    }
  digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
  digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
}

Here is a video of the Teensy displaying text on two 64x32 LED arrays.

Monday, March 25, 2019

Panasonic AG-DVC7 Videocamera Power Switch Repair

I have two Panasonic AG-DVC7 professional Camcorders that I bought at a Hamfest.  I thought I would test them out again as they do not always power on.  Both cameras needed new on/off switches.  I also had to dissemble one camera to fix a loose connector to the tape transport.  This is what the guts look like.
Panasonic AG-DVC7 Dissembled

 Inside the handle there is a removable assembly that contains the power switch.

I soldered a switch to the two end contacts on the switch.

Then reassemble the control board with the switch wires coming out like this.

Then drill a hole in the top of the handle next to the "photo Shoot" button for the new power switch.

Monday, March 18, 2019

Arduino Uno running a MSGEQ7 and a LCD

I Have an Arduino Uno running a MSGEQ7 and a LCD.  It is sampling each frequency twice for 14 samples each channel.  The MSGEQ7 control pins are connected to D2 and D3.


Here is a video of it working.



Here it is simulating an analog meter.


I added a 4052 analog mux to the MSGEQ7's to get 28 frequencies per channel.


This is the same setup with a sweep generator.


Here is a video with a stereo analog meter.

Friday, March 8, 2019

Arduino UNO with 64x32 LED Array Displaying Analog Data

Arduino UNO with 64x32 LED Array Displaying Analog Data

I am working on a book titled "Arduino Audio Projects" and one of the projects I am creating is to display the outputs of a MSGEQ7 on the 64x32 LED matrix.  As a starting point, the first step is to display the status of A4 and A5 while running the matrix.


Video displaying the Analog inputs A4 and A5



I have successfully added a MSGEQ7 to the Arduino UNO!

Here is the first video with a MSGEQ7 added.


I rotated the display by changing the software!


Here is how to modify the MSGEQ7 shield so its control pins do not interfere with the RGB Hat.


The code is at: https://github.com/bobdavis321/Arduino-Audio-Projects