Saturday, October 31, 2020

[Arduino] Pemograman LED MAX 7219 dengan Arduino Uno

Pemograman LED MAX 7219 dengan Arduino Uno

 Gambar Diagram Koneksi Pin


Program di Arduino:

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>


#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// HARDWARE SPI
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

int i = 0;
textEffect_t texteffect[] =
{
  PA_PRINT,
  PA_SCAN_HORIZ,
  PA_SCROLL_LEFT,
  PA_WIPE,
  PA_SCROLL_UP_LEFT,
  PA_SCROLL_UP,
  PA_OPENING_CURSOR,
  PA_GROW_UP,
  PA_MESH,
  PA_SCROLL_UP_RIGHT,
  PA_BLINDS,
  PA_CLOSING,
  PA_RANDOM,
  PA_GROW_DOWN,
  PA_SCAN_VERT,
  PA_SCROLL_DOWN_LEFT,
  PA_WIPE_CURSOR,
  PA_DISSOLVE,
  PA_OPENING,
  PA_CLOSING_CURSOR,
  PA_SCROLL_DOWN_RIGHT,
  PA_SCROLL_RIGHT,
  PA_SLICE,
  PA_SCROLL_DOWN
};

void setup() {
  myDisplay.begin();
  myDisplay.setIntensity(0);
  myDisplay.setTextAlignment(PA_CENTER);
  myDisplay.setPause(1000);
  myDisplay.setSpeed(30);
  myDisplay.displayClear();
}


void loop() {
  if (myDisplay.displayAnimate()) {
    if (i < sizeof(texteffect)) {
      i++;
    }
    else {
      i = 0;
    }
    myDisplay.displayText("Hebat", myDisplay.getTextAlignment(), myDisplay.getSpeed(),                       myDisplay.getPause(), texteffect[i], texteffect[i]);
    myDisplay.displayReset();
  }
}

[Arduino] Pemograman RTC DS3231 dengan Arduino Uno

 Pemrograman RTC DS3231 dengan Arduino Uno


 

 

# belajar03-arduino-ds3231.ino

#include <Wire.h>
#include "RTClib.h"

/*
 *  Program RTC DS3231 Dengan ardunio uno
 *  Tgl : 31 oktober 2020
 *  Koneksi Pin RTC3231 ke PIN Arduiono UNO
 *    GND -> GND
 *    VCC -> +5V
 *    SCL -> A5
 *    SCA -> A4
 *  Provide by : aplikasi-hebat Studio
 *  
 */
 
//init rtc3231
RTC_DS3231 rtc;

 //
char daysOfTheWeek[7][12] = {"Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"};
 
void setup () {
  //init serial komunikasi dengan serial komputer utk tampil di serial monitor
  Serial.begin(9600);
  rtc.begin();
  delay(3000); // wait for console opening
  //setting tanggal awal: thn,bulan,tgl,jam,menit,detik
  rtc.adjust(DateTime(2020, 10, 31, 15, 22, 0));
  }

 
void loop () {
    DateTime now = rtc.now();
 
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    Serial.println();
    delay(1000);
}

Pemrograman Running text P10 RGB dengan Arduino Nano

Pemrograman Running text P10 RGB dengan Arduino Nano PIN CONNECTION P10 RGB DENGAN ARDUINO NANO/UNO Source code arduino p10 RGB  #include &q...