Go Down

Topic: Controling the LED intensity by read a txt file from a SD card (Read 370 times) previous topic - next topic

bobijack

Hi !

sory for my poor english ... =(

I need your help for a project :

- first i want to control the intensity of a led by reading a text file :

here a exemple of a textfile :
myFile.txt :
Code: [Select]

255,100,255,50,100,20,10,200,50,90,85,200,0,0,0,255


my equipment :
Arduino Uno, microSD Shield, power led shield, micro card SD

So exacly what i want :
during 60 seconds my leds light intensity i and after the intensity  i+1 etc. ...

I know how read a text file and open a text file with the SD library but i don't know how to parse my text file and get the good intensity at the time t :smiley-roll-sweat:

so i want something like that :
Code: [Select]

# open and read the textfile from the SD card
# for t to end of the textfile
      intensity = intensity at t
      analogWrite(led,intensity)
      delay(60000)
# for each time t i want to know the intensity i on my screen
      Serial.println(intensity);


- in a second time i want to do that for 2 leds with 2 differents array on the same text file.

If you have some exemples and ideas :)
thanks so much :)

Ps : i'm very very big beginner in Arduino language ...

Go Up