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
Datatypes
1. void --> Returns no information
2. boolean --> 8 bit (0 or 1)
3. char --> signed 8-bit (-128 to 127)
4. Unsigned char/byte --> unsigned 8-bit (0 to 255)
5. int/short --> signed 16-bit (-32,768 to 32,767)
Due --> signed 32-bit (-2,147,483,648 to 2,147,483,647)
6. unsigned int/word --> unsigned 16-bit (0 to 65,535)
Due --> unsigned 32-bit (0 to 4,294,967,295)
@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;