This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DS3231.h> | |
#include <Wire.h> | |
#include "FS.h" | |
#include "SD.h" | |
#include "SPI.h" | |
#define SD_CS 5 | |
DS3231 Clock; | |
byte tahun; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// penggunaan if | |
if(digitalRead(7) == LOW){ | |
digitalWrite(8, HIGH); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
pinMode(12, OUTPUT); | |
pinMode(11, OUTPUT); | |
pinMode(2, INPUT_PULLUP); | |
} | |
void loop() { | |
if(digitalRead(2) == LOW){ | |
digitalWrite(12, HIGH); | |
digitalWrite(11, HIGH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display | |
void setup() | |
{ | |
lcd.init(); // initialize the lcd | |
lcd.backlight(); | |
lcd.setCursor(0,0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x20,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display | |
void setup() | |
{ | |
lcd.init(); // inisialisasi the lcd | |
lcd.backlight(); | |
lcd.setCursor(0,0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_ADXL345_U.h> | |
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); | |
void setup() { | |
Serial.begin(9600); | |
#ifndef ESP8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Descending(){ | |
for (int i = 0; i < banyakData; i++){ | |
for (int j = 0; j < banyakData; j++){ | |
if (parsing[j] < parsing[i]){ | |
float tmp = parsing[i]; // menyimpan nilai ke varibel temporer sebelum ke variabel sesungguhnya | |
parsing[i] = parsing[j]; // memindahkan nilai pada parsing[j] ke parsing[i] | |
parsing[j] = tmp; // memindahkan nilai pada parsing[i] ke parsing[j] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Ascending(){ | |
for (int i = 0; i < banyakData; i++){ | |
for (int j = 0; j < banyakData; j++){ | |
if (parsing[j] > parsing[i]){ | |
float tmp = parsing[i]; // menyimpan nilai ke varibel temporer sebelum ke variabel sesungguhnya | |
parsing[i] = parsing[j]; // memindahkan nilai pada parsing[j] ke parsing[i] | |
parsing[j] = tmp; // memindahkan nilai pada parsing[i] ke parsing[j] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "FS.h" | |
#include "SD.h" | |
#include "SPI.h" | |
#define SD_CS 5 | |
void deleteFile(fs::FS &fs, const char * path){ | |
Serial.printf("Deleting file: %s\n", path); | |
if(fs.remove(path)){ | |
Serial.println("File deleted"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "FS.h" | |
#include "SD.h" | |
#include "SPI.h" | |
#define SD_CS 5 | |
void renameFile(fs::FS &fs, const char * path1, const char * path2){ | |
Serial.printf("Renaming file %s to %s\n", path1, path2); | |
if (fs.rename(path1, path2)) { | |
Serial.println("File renamed"); |