Closed dallen98 closed 3 years ago
in the above example I wish to use 60w x 34h .H image and when I view it on my ws2812b 60w x 34h matrix the code seems to shrink it down to 32x32, where in the code can I either disable or define my 60x34 without it getting shrunk below is how my matrix is set up thanks
CRGB leds[NUMMATRIX]; // Define matrix width and height. FastLED_NeoMatrix *matrix = new FastLED_NeoMatrix(leds, mw, mh, NEO_MATRIX_TOP + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG);
I'm sorry, your description is way too vague for me to know what your issue is. mw and mh are defined correctly, so that part should work.
You probably want to go through this guide: https://learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library It doesn't use my library, but explains how neomatrix works, and also the adafruit neopixel library is less capable, you can probably try that first if you need a step by step which you can likely apply to my lib as they are compatible in how they work. If you end up using the adafruit lib first, once that works, you can switch back to FastLED which is better in hardware support and faster with the options it offers.
Yes sorry I badly worded the above, what I want is simply a scrolling text and a static bitmap which is 60px wide x 34px wide, to this end my loop looks like this.. void loop() { display_scrollText(); //display_panOrBounceBitmap(32); display_panOrBounceBitmap(); } so I,m trying to edit the below to display my "bitmap32" (which is 60wx32h) statically not bouncing around, any help much appreciated.
`void display_panOrBounceBitmap (uint8_t bitmapSize) { // keep integer math, deal with values 16 times too big // start by showing upper left of big bitmap or centering if the display is big int16_t xf = max(0, (mw-bitmapSize)/2) << 4; int16_t yf = max(0, (mh-bitmapSize)/2) << 4; // scroll speed in 1/16th int16_t xfc = 6; int16_t yfc = 3; // scroll down and right by moving upper left corner off screen // more up and left (which means negative numbers) int16_t xfdir = -1; int16_t yfdir = -1;
for (uint16_t i=1; i<200; i++) {
bool updDir = false;
// Get actual x/y by dividing by 16.
int16_t x = xf >> 4;
int16_t y = yf >> 4;
matrix->clear();
// bounce 8x8 tri color smiley face around the screen
if (bitmapSize == 8) fixdrawRGBBitmap(x, y, RGB_bmp[10], 8, 8);
// pan 24x24 pixmap
if (bitmapSize == 24) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap24, bitmapSize, bitmapSize);
if (bitmapSize == 32) matrix->drawRGBBitmap(x, y, (const uint16_t *) bitmap32, bitmapSize, bitmapSize);
matrix->show();
// Only pan if the display size is smaller than the pixmap
// but not if the difference is too small or it'll look bad.
if (bitmapSize-mw>2) {
xf += xfc*xfdir;
if (xf >= 0) { xfdir = -1; updDir = true ; };
// we don't go negative past right corner, go back positive
if (xf <= ((mw-bitmapSize) << 4)) { xfdir = 1; updDir = true ; };
}
if (bitmapSize-mh>2) {
yf += yfc*yfdir;
// we shouldn't display past left corner, reverse direction.
if (yf >= 0) { yfdir = -1; updDir = true ; };
if (yf <= ((mh-bitmapSize) << 4)) { yfdir = 1; updDir = true ; };
}
// only bounce a pixmap if it's smaller than the display size
if (mw>bitmapSize) {
xf += xfc*xfdir;
// Deal with bouncing off the 'walls'
if (xf >= (mw-bitmapSize) << 4) { xfdir = -1; updDir = true ; };
if (xf <= 0) { xfdir = 1; updDir = true ; };
}
if (mh>bitmapSize) {
yf += yfc*yfdir;
if (yf >= (mh-bitmapSize) << 4) { yfdir = -1; updDir = true ; };
if (yf <= 0) { yfdir = 1; updDir = true ; };
}
if (updDir) {
// Add -1, 0 or 1 but bind result to 1 to 1.
// Let's take 3 is a minimum speed, otherwise it's too slow.
xfc = constrain(xfc + random(-1, 2), 3, 16);
yfc = constrain(xfc + random(-1, 2), 3, 16);
}
delay(10);
}
}`
Ok, this does not seem like a problem with my library but you need help with your custom code (if I misunderstood, sorry). the first line you sent in your report, does say "Do not use GitHub issues for troubleshooting projects and issues. "
Long story short, I gets hundreds of emails per day, I really don't have time to help people with custom code, or I wouldn't get any of my own work done, sorry about that.
Thank you for opening an issue on an Adafruit Arduino library repository. To improve the speed of resolution please review the following guidelines and common troubleshooting steps below before creating the issue:
Do not use GitHub issues for troubleshooting projects and issues. Instead use the forums at http://forums.adafruit.com to ask questions and troubleshoot why something isn't working as expected. In many cases the problem is a common issue that you will more quickly receive help from the forum community. GitHub issues are meant for known defects in the code. If you don't know if there is a defect in the code then start with troubleshooting on the forum first.
If following a tutorial or guide be sure you didn't miss a step. Carefully check all of the steps and commands to run have been followed. Consult the forum if you're unsure or have questions about steps in a guide/tutorial.
For Arduino projects check these very common issues to ensure they don't apply:
For uploading sketches or communicating with the board make sure you're using a USB data cable and not a USB charge-only cable. It is sometimes very hard to tell the difference between a data and charge cable! Try using the cable with other devices or swapping to another cable to confirm it is not the problem.
Be sure you are supplying adequate power to the board. Check the specs of your board and plug in an external power supply. In many cases just plugging a board into your computer is not enough to power it and other peripherals.
Double check all soldering joints and connections. Flakey connections cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.
Ensure you are using an official Arduino or Adafruit board. We can't guarantee a clone board will have the same functionality and work as expected with this code and don't support them.
If you're sure this issue is a defect in the code and checked the steps above please fill in the following fields to provide enough troubleshooting information. You may delete the guideline and text above to just leave the following details:
Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE
Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO VERSION HERE
List the steps to reproduce the problem below (if possible attach a sketch or copy the sketch code in too): LIST REPRO STEPS BELOW