Skip to content

Instantly share code, notes, and snippets.

View Marzogh's full-sized avatar
🏔️
Off the grid - as much as possible

Marzogh Marzogh

🏔️
Off the grid - as much as possible
View GitHub Profile
@Marzogh
Marzogh / Code to add Date and Time to files written to SD cards.ino
Last active March 8, 2024 19:40
This code allows you to add the date and time to your SD card log files generated by an Arduino.
#include <SD.h>
File file;
const uint8_t CS = 10; // SD chip select
// YOUR SKETCH SHOULD UPDATE THESE SIX VALUES
// EACH TIME BEFORE CREATING YOUR SD CARD FILE
unsigned int year = 2015;
byte month = 6;
byte day = 18;
@Marzogh
Marzogh / LED color functions
Created March 15, 2015 13:11
LED color codes for Arduino and other Microprocessors
// The ledIO() function turns on or off an LED (in a particular color - if RGB) based on the mode passed to it. The mode can be the color of LED - in lower case - if RGB
//or simply on or off if a single color LED
void ledIO(uint8_t mode)
{
switch (mode) {
case 1: //RED
digitalWrite(RLED, HIGH);
digitalWrite(GLED, LOW);
digitalWrite(BLED, LOW);
break;