Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems for 7x12 pixel display #1

Open
hatschibratschi opened this issue Apr 11, 2020 · 0 comments
Open

Problems for 7x12 pixel display #1

hatschibratschi opened this issue Apr 11, 2020 · 0 comments

Comments

@hatschibratschi
Copy link

hatschibratschi commented Apr 11, 2020

hi @giladaya ,
i used your code for my little project here
https://create.arduino.cc/projecthub/hatschibratschi/flame-simulation-916431

and i found a bug

your version uses a 8x8 matrix - i used the 7x12 matrix of the arduino mkr rgb shield and i had only problems with the code after your //first row interploation...
your flame is 8 pixles wide, but i wanted a candle-like flame with only 3 pixels at the bottom getting a littel wider. that was olny possible by changing the code to this version:

  //first row interpolates with the "next" line
  for(unsigned char x = 0; x < M_HEIGHT; x++) {
      colorHSV.h = hueMask[0][x];
      colorHSV.s = 255;
      nextv = 
          (((100.0-pcnt) * f_matrix[x][0] 
        + pcnt * f_line[x])/100.0) 
        - valueMask[0][x];
      colorHSV.v = (unsigned char) max (0, nextv);
      
      HSVtoRGB(&colorRGB, &colorHSV);
      setPixel(x, 0, colorRGB.r, colorRGB.g, colorRGB.b);
  }

thank you for your very gread code and i hope you like my version as well.

greetings from vienna!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant