Hello everybody Sorry for the bad english.

Hello everybody
Sorry for the bad english.

I want to do pov stick with Attiny85

I can’t view bmp in this project.
also
Can I add micro sd card module

Thanks for your help now

project code

include < Arduino.h >

include < FastLED.h >

include < avr / power.h >

define NUMPIXELS 10 // Strig içindeki LED sayısı

define CLOCK_PIN 2 // Arduino’da “Pin 2”, yonga pimi # 7

define DATA_PIN 0 // Arduino’da “Pin 0”, yonga pimi # 5

define COLOR_ORDER RBG // şeriem BGR

define DÜZELTME TipikLEDStrip

Tanımlar BUTTON1 4

HEARTBEAT_LED 3 tanımlayın

// 11 x 10 = 110

IMAGE_LENGTH olanağını tanımlayın 110

IMAGE_WIDTH 10 tanımla

IMAGE_HEIGHT 10 tanımla

// resim [column_index * IMAGE_WIDTH + row_index]; argüman 0’dan başlayacaktır (IMAGE_WIDTH * IMAGE_HEIGHT -1)
// row_index ile 0 arasında (IMAGE_WIDTH - 1);
// column_index, 0 ile (IMAGE_HEIGHT - 1) arasında
// kalp
/ * const uint8_t görüntü [] =
{0,01,1,0,0,0,1,1,0,0,
0,1,0,0,1,0,1,0,0,1,0,
1,0,0,0,0,1,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,1,
1,0,0,0,0,0,0,0,0,0,1,
0,1,0,0,0,0,0,0,0,1,0,
0,0,1,0,0,0,0,0,1,0,0,
0,0,0,1,0,0,0,1,0,0,0,
0,0,0,0,1,0,1,0,0,0,0,
0,0,0,0,0,1,0,0,0,0,0};

  • /
    / * const boolean görüntüsü [] =
    {1,1,0,1,0,1,0,1,0,1,1,
    1,0,1,0,1,0,1,0,1,0,1,
    1,1,0,1,0,1,0,1,0,1,1,
    1,0,1,0,1,0,1,0,1,0,1,
    1,1,0,1,0,1,0,1,0,1,1,
    1,0,1,0,1,0,1,0,1,0,1,
    1,1,0,1,0,1,0,1,0,1,1,
    1,0,1,0,1,0,1,0,1,0,1,
    1,1,0,1,0,1,0,1,0,1,1,
    1,0,1,0,1,0,1,0,1,0,1};
  • /
    // kalp transp
    / * const uint8_t görüntü [] =
    {0,0,1,1,1,0,0,0,0,0,
    0,1,0,0,0,1,0,0,0,0,
    1,0,0,0,0,0,1,0,0,0,
    1,0,0,0,0,0,0,1,0,0,
    0,1,0,0,0,0,0,0,1,0,
    0,0,1,0,0,0,0,0,0,1,
    0,1,0,0,0,0,0,0,1,0,
    1,0,0,0,0,0,0,1,0,0,
    1,0,0,0,0,0,1,0,0,0,
    0,1,0,0,0,1,0,0,0,0,
    0,0,1,1,1,0,0,0,0,0};
  • /
    // transp ve çevir
    const uint8_t görüntü [] =
    { 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 ,
    0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 ,
    0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 ,
    0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ,
    0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 ,
    1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 ,
    0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 ,
    0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ,
    0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 ,
    0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 ,
    0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 0 , 0 };
    / *
    ICSP başlığı, iğneye bakıyor (dişi kabloya bakmıyor):
    1 MISO 2 VCC
    3 SCK 4 MOSI
    5 RST 6 GND
    ATTiny85:
    1 RST 5 VCC
    2 NC 6 SCK
    3 NC 7 MISO
    4 GND 8 MOSI
  • /

CRGB ledleri [NUMPIXELS];

// BGR ile
// Kırmızı coef yeşil
// Yeşil sığır eti mavi
// bu yüzden mavi kırmızı

uint32_t timeNow = 0 ;
uint32_t heartbeatInterval = 500 ;
uint32_t lastTimeHeartbeat = 0 ;

uint32_t prog1_sweepInterval = 0 ;
uint32_t prog1_lastTimeSweep = 0 ;

uint32_t prog2_sweepInterval = 3 ;
uint32_t prog2_lastTimeSweep = 0 ;

uint8_t heartbeatLed = 0 ;
uint8_t buttonState = 0 ;

geçersiz ayar ()
{
eğer (F_CPU == 16000000 )
{
clock_prescale_set (clock_div_1);
}

pinMode (HEARTBEAT_LED, OUTPUT);
pinMode (BUTTON1, GİRİŞ);

digitalWrite (HEARTBEAT_LED, YÜKSEK);

FastLED. addLeds <APA102, DATA_PIN, CLOCK_PIN, COLOR_ORDER> (led, NUMPIXELS)
. setCorrection (CORRECTION);

için ( int i = 0 ; i <NUMPIXELS; i ++)
{
	ledler [i] = CRGB ( 16 , 0 , 16 );
}
FastLED. setBrightness ( 32 );
FastLED. show ();

}

int8_t sweepIndex = 0 ;
int8_t sweepDir = 1 ;
uint8_t rainbowIncrement = 7 ;
uint8_t rainbowStart = 0 ;
uint8_t column_index = 0 ;
uint8_t row_index = 0 ;
geçersiz program_1 ( void )
{
rainbowStart = gökkuşağıStart + 1 ;
FastLED. setBrightness ( 96 );
fill_rainbow ( leds , NUMPIXELS, rainbowStart, rainbowIncrement);
için ( int ROW_INDEX = 0 ; ROW_INDEX <IMAGE_HEIGHT; ROW_INDEX ++)
{
// resim [column_index * IMAGE_WIDTH + row_index]; argüman 0’dan başlayacaktır (IMAGE_WIDTH * IMAGE_HEIGHT -1)
// row_index ile 0 arasında (IMAGE_HEIGHT - 1);
// column_index, 0 ile (IMAGE_WIDTH - 1) arasında
if (image [column_index * IMAGE_WIDTH + row_index] == 0 )
{
ledler [row_index] = CRGB ( 0 , 0 , 0 );
}
// başka
// {
// leds [row_index] = CRGB (32, 0, 32);
// }
}
column_index ++;
eğer (column_index == IMAGE_WIDTH)
{
column_index = 0 ;;
}
};

geçersiz program_2 ( void )
{
FastLED. setBrightness ( 32 );
rainbowStart = gökkuşağıStart + 1 ;
fill_rainbow ( leds , NUMPIXELS, rainbowStart, rainbowIncrement);
}

boşluk döngüsü ()
{
timeNow = millis ();
buttonState = digitalRead (BUTTON1);

if (timeNow - lastTimeHeartbeat> heartbeatInterval)
{
	lastTimeHeartbeat = timeNow;
	eğer (heartbeatLed == 0 )
	{
		heartbeatLed = 1 ;
		digitalWrite (HEARTBEAT_LED, LOW);
	}
	Başka
	{
		heartbeatLed = 0 ;
		digitalWrite (HEARTBEAT_LED, YÜKSEK);
	}
}

eğer (! buttonState)
{
	if (timeNow - prog1_lastTimeSweep> prog1_sweepInterval)
	{
		prog1_lastTimeSweep = timeNow;
		program_1 ();
		FastLED. show ();
	}
}
Başka
{
	if (timeNow - prog2_lastTimeSweep> prog2_sweepInterval)
	{
		prog2_lastTimeSweep = timeNow;
		program_2 ();
		FastLED. show ();
	}
}

}

Hello @Ahmet_Gunes What are you trying to do exactly ? Could you post your code on gist ? It will be easier to look at and modify.

Hello @Yves_BAZIN

I actually
I want to do this project with attiny85

but in this project

(I uploaded the code to github)

I could not display the image on the leds

Sincerely

@Ahmet_Gunes
apparently i wrate two messages that were blocked. anyway could you replace
NUMPIXELS 10 by NUMPIXELS 100
you are only initialising 10 leds for the moment

Im not sure this can be accomplished with an attiny85, but I’d like to be proven wrong. :slight_smile: I’ve got 35 apa102s on a pro trinket and I can only get like 10 images total, but I’ve got a remote so that might be a constraint.

There are a bunch of other POV projects between an attiny85 & uno size - see https://learn.adafruit.com/search?q=pov&view=all Not to encourage cross posting, but the adafruit forum may be a good place to check.
https://learn.adafruit.com/search?q=pov&view=allNot