SD card attached to ATmel 328P-PU SPI bus as follows:
MOSI - pin 11
MISO - pin 12
CLK - pin 13
CS - pin 10
If you are unfamiliar with barebones Arduinos, this should help: https://www.instructables.com/id/Standalone-Arduino-ATMega-chip-on-breadboard/ I am not doing an Instructable on barebones, so you may have to do some independent research! Oh, yea, there is that disclosure at the first of this article stating that this may not work for you.
YES, Colors mean something:
I use a single tri-color LED with a single 150 Ohm resistor for current limiting. I never have more than one segment on at a time... that means that I turn OFF any ON led before turning ON another one... pretty simple. At power-on, each LED is turned on in sequence. Then, blinking RED indicates a problem with mounting the SD card file system. After 5 seconds, the software resets and will try and re-mount. This gives the user time to get the SD Card and insert before RESET.
GREEN is used to indicate characters being loaded into the program buffer. It is pretty dim because the event lasts but a short time.
BLUE is used to indicate characters being transferred from the program buffer to the SD 512 dedicated RAM buffer and then to the SD Card for sector updating. This happens fairly quickly, quickly enough that the chip will maintain full-sync with a 9600 BAUD input signal without loosing characters.
About SD Cards:
Some forum folks indicate that the Arduino and SD library works better with lower-cost, older SD cards. I can not confirm this as I only have old full-size SD cards and I'm too cheap to go out and buy the new high-speed SD cards just to test. This one is for you...
Removing the SD card will result in lost data, that is, what is in the 328 RAM buffer. Removing the SD Card during a write as the buffer is being transferred to the SD card will result in data loss AND may damage the file system. In general use, only the program buffer is lost (each carriage returns dumps the buffer to the card) so the correct process is to remove power and then remove the SD card... a minimum of loss will occur. Complete loss can be avoided by having the upstream data stream program issue two (2) carriage returns... the first one will write the buffers and the second one will simply write a blank line. This however does create extra "wear" on the SD card. Another solution is to use any of the many unused digital pins and install a push button and write a little code to force a buffer dump when the button is pushed. Lots of options which I did not implement.
This is probably the strangest Instructable that I have authored in my two years here... because the project is not intended for beginners or intermediates... I'm just not providing that level of instruction/support. I hope if you take on this project that you are successful... I was.
Guess there is nothing else to do than to upload the ZIP source code.