Where can a complete beginner to programming go to learn what this is all about?

Hello, I am a complete beginner to Arduino and any code really. I bought a kit and have been playing around with a few things. I made a few projects by copying code and modifying what I could to get what I want (I made a flow sensor for my keg (Kegomatic was where I began). There are so many things in the code I just can't wrap my head around.

Currently I am making an led matrix and controlling it with the NeoMatrix library. I bought a strip of SK6812 leds and arranged them into a matrix panel. Is there a place that describes what everything is in the NeoMatrix library? I can change the text that scrolls and change the color to a single color. I want to be able to modify the colors to have a gradient or maybe even every other letter is a different color. I just can't seem to find the correct code to do this. Thanks for pointing me in the right direction.

I modified the example code to get where I am now. I am using an Arduino Nano.


#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
 #define PSTR // Make Arduino Due happy
#endif

#define PIN 7


Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(16, 12, PIN,
  NEO_MATRIX_TOP     + NEO_MATRIX_LEFT +
  NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
  NEO_GRBW           + NEO_KHZ800);

const uint16_t colors[] = {
  matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };

void setup() {
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(40);
  matrix.setTextColor(colors[0]);
}

int x    = matrix.width();
int pass = 0;

void loop() {
  matrix.fillScreen(0);
  matrix.setCursor(x, 2);
  matrix.print(F("THIS IS MY TEST TEXT AND IT WORKS"));
  if(--x < -200) {
    x = matrix.width();
    if(++pass >= 3) pass = 0;
    matrix.setTextColor(colors[pass]);
   
  }
  matrix.show();
  delay(40);
}

Here is a photo. I don't know how to upload a video clip.

Be more specific.  There's an ocean of web pages and YT videos about Arduino and C++ and computer programming in general.  Type in something you don't understand to your favorite search engine.  Have a look also at the Arduino Reference - Arduino Reference

Arduino sketches are C++. Any of a vast number of C++ tutorials you may find will be helpful. Also, the language syntax and semantics are one thing, learning to think in a completely logical manner is key to being able to design your own programs.

Adafruit has extensive documentation. Google can generally find the information. I just typed 'Adafruit Neomatrix Library' into Google and the first result is:

You know how to set the text color. If you display the text one character at a time you will then have the opportunity to use a different color for each character. Doing a gradient where the color changes for each column of pixels is probably harder. My guess is that you would have to draw the text into an off-screen buffer and then display the buffer one column at a time, changing the foreground and background colors for each column.

That is what I do. For instance, I search for "matrix.Color" to see how to manipulate that and I don't really find what I'm looking for. For this particular sketch I want the colors to change AS the text scrolls.

I will look into that link you sent, thank you.

Yes I have read that page a few times. I think I need to check out some of the C++ tutorials to get a better idea.

Adafruit doesn't call the library "matrix". That's just the variable name they use in that example. Look for the library name.

Take a look at the .h and the . cpp files... Coding is: have a problem.....How would i solve it.... break it into small parts... (think of how do i go to work in details) (btw i'm retired long time ago :wink: ) and solve every detail, step by step..... someone who is coding without trial and error doesn't exist (i think)..

I will look at those files. Trial and error has got me this far. Thanks.

Schematic please. Pencil on paper is fine but without a schematic, we don't really know your setup. (Please NO fritzing pictures).

From the photo, it looks like you have a power problem. What do the wires off the top of the photo go to?

What is "fritzing"?

Those are the power and data wires that connect to the Arduino. I added power to the other end as well to supply more power if I intend to go full intensity on the leds. This is just a test setup I made to learn.

This video here does a good job going over the code. I need to find more like it.

Please. Don't earn Fritzing. People here will appreciate you for it.

When you post your schematic, a hand drawn circuit in jpg or png is far preferable over a pretty Fritzing picture. A schematic is way simpler and easy to understand than a physical layout. The schematic is a functional description describing the flow of operation. The symbols actually describe functions and are read as such, something Fritzing does poorly. Using Fritzing will reduce the pool of folks prepared to even look at your problem. Do not hurry drawing a schematic, it is a very valuable tool to help you and us understand your project.

1 Like

Still, not clear. How are the LEDs getting power? Just grab a pencil and paper and draw a picture. Be sure to label the connections.

It is a simple set up. Pin 7 of the Nano goes to a resistor and then the DIN on the LED strip, GND from the Nano goes to the GND of the LED and same for the 5v from the Nano.

Still incomplete- show the LED power source and how it's connected. Show the Nano power source and how it's connected.

The reason that I am being so anal is because from your photo and schematic----- it shouldn't work.

If you really try to power so many RGB leds from your arduino you will burn through the voltage-regulator of the arduino.

You are a lucky guy in case you powered all the RGB-LEDS from the arduinos 5V pin.
Anything that is different from a single LED or a low-power sensor
must have its own powersupply to make things work properly.

The schematic you have posted is almost fritzing.

I'm very very serious: a freehand drawn schematic is preferred 1000 times more than such a fancy picture that you have posted.

The reason is that in a hand-drawn schematic you draw just the relevant information. Which means those IO-pins that something is connected to. And all IO-pins that has nothing connected are left out.

best regards Stefan

Well... if you power it over USB and connect the +5V of the leds to Vin.. you might be lucky.. I didn't expect it but during programming i lit 1024 bright of those WS2812 by accident.. It also took a while before i had turned them off... Appearently the nowadays USB ports can supply more than just a mouse..
BUT: an external powersupply is better.

I find this "fritzing" thing fascinating. I tried to draw a schematic but it was more "fritzing" looking than the image I posted earlier. I tried to make one very simple so I attached that. The Nano is powered by the USB port connected to my laptop. The SK6812 RGBW LED strip is powered FROM the Nano 5v output. This 16.4 foot strip seems to work just fine other than pushing full white to it.

The strip is arranged in the Zig Zag orientation.

I did read that LED strips require power injected when you do long runs. I did put a power connector on the other end to try that out but it doesn't work.

I mean it is working beautifully. These things are bright.

So how exactly do I power the Arduino AND the LED strips separately ?

Hi chaz,

very good hand-drawn schematic.

For supplying the LED-strips you should use an extra power-supply that is capable of delivering more current than the maximum-current of all LEDs switched on at full brightness are drawing.

Even in case that you say I will "never" switch on all LEDs at the same time full bright white and full bright red green blue at the same time.
Well accidently through a software bug or a bad connected data-in wire it might happen.

So with examples numbers: if all LEDs can draw a maximum current of 0,6A you should use a 1A power-supply. There should still be some air between the maximum of the power-consumption and the maximum power-delivery of the supply.

best regards Stefan

Thank you for this. I made up an external power source and it works beautifully. Is it still safe to connect the nano to my laptop via the usb while I have an external power source connected to it?