SINAU PROGRAMMING
SINAU PROGRAMMING
  • Home
  • Source Code
  • Social
  • CONTROL
    • Internet of Think (IoT)
    • ESP
      • NodeMcu
      • Lora
      • WeMos
      • Esp 32 Dev
      • Node 32s
    • Arduino
    • Raspberry
    • Proteus
  • MATLAB
    • MATLAB PROJECT
    • PLC
      • Omron
      • Mitsubishi
      • Siemens
      • Schneider
      • ArduinoPLC
    • Arduino
    • Basic & Doc
  • Contact Us

 Anda dapat menampilkan gambar monowarna bitmap 128x64 pada layar OLED.

rangkaian esp32 dan oled sebagai tampilan

bisa gunakan 2 Adafruit libraries ini: Adafruit_SSD1306 library and Adafruit_GFX library.

Pertama, gunakan program pencitraan untuk mengubah ukuran foto atau gambar dan menyimpannya sebagai bitmap monokrom. Jika Anda menggunakan PC Windows, Anda dapat menggunakan Paint

contoh dibawah ini :




Kemudian, gunakan konverter Image to C Array untuk mengonversi gambar menjadi array. Saya telah menggunakan LCD Image Converter.

Jalankan program dan mulai dengan New Image. Buka Image > Impor dan pilih gambar bitmap yang telah Anda buat sebelumnya.

Buka Opsi > Konversi dan di tab Persiapkan, pilih opsi berikut:

  • Type: Monochrome, Threshold Dither
  • Main Scan Direction: Top to Bottom
  • Line Scan Direction: Forward

Go to the Image tab and select the following options:

  • Split to rows
  • Block size: 8 bit
  • Byte order: Little-Endian

Lalu, klik Oke. Terakhir, di menu utama, buka File > Convert. File baru dengan ekstensi .c harus disimpan. File itu berisi larik C untuk gambar. Buka file itu dengan editor teks, dan salin array.


dalam gambar ini array yg kita buat seperti dibawah

static const uint8_t image_data_gambar[1024] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf0, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff,
    0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x0f, 0xff,
    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x07, 0xff,
    0xff, 0xfc, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xf8, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xff, 0xe0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x07, 0xff,
    0xff, 0xff, 0xfe, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xff,
    0xff, 0xff, 0xff, 0x80, 0x0e, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xc0, 0x7f, 0xff,
    0xff, 0xff, 0xff, 0xf0, 0x20, 0x00, 0x03, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfc, 0x80, 0x00, 0x01, 0xff, 0xff, 0xff, 0x00, 0x10, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x07, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};



Full Code Seperti dibawah ini:



#include <Adafruit_SSD1306.h>
#include <stdint.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

static const uint8_t image_data_gambar[1024] = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0xe0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x80, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf0, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff,
    0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x0f, 0xff,
    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x07, 0xff,
    0xff, 0xfc, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xf8, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0xff,
    0xff, 0xff, 0xe0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x07, 0xff,
    0xff, 0xff, 0xfe, 0x00, 0x0c, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xff,
    0xff, 0xff, 0xff, 0x80, 0x0e, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x03, 0xff, 0xc0, 0x7f, 0xff,
    0xff, 0xff, 0xff, 0xf0, 0x20, 0x00, 0x03, 0xff, 0xff, 0xff, 0xc0, 0x00, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xfc, 0x80, 0x00, 0x01, 0xff, 0xff, 0xff, 0x00, 0x10, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x07, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
 
void setup() {
  Serial.begin(115200);
 
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  delay(2000); // Pause for 2 seconds
 
  // Clear the buffer.
  display.clearDisplay();
 
  // Draw bitmap on the screen
  display.drawBitmap(0, 0, image_data_gambar, 128, 64, 1);
  display.display();
}
 
void loop() {
 
}




 


ILI9341 adalah driver SOC chip tunggal 262,144 warna untuk layar kristal cair A-TFT dengan resolusi 240RGBx320 Dots. Terdiri dari driver sumber 720- channel, driver gerbang 320-channel, GRAM 172.800 byte untuk grafis menampilkan data 240RGBx320 titik, dan sirkuit catu daya.

library 

  • Adafruit ILI9341
  • Adafruit_GFX.h

PROGRAM Menampilkan ILI9341



/*
  Simple "Hello World" for ILI9341 LCD

  https://wokwi.com/arduino/projects/308024602434470466
*/

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

void setup() {
  tft.begin();

  tft.setCursor(26, 120);
  tft.setTextColor(ILI9341_RED);
  tft.setTextSize(3);
  tft.println("Hello, TFT!");

  tft.setCursor(20, 160);
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(2);
  tft.println("I can has colors?");

  // Meme reference: https://english.stackexchange.com/questions/20356/origin-of-i-can-haz
}

void loop() { }




Dear Author, Researcher

We offer you to submit your paper to the journal Medika Trada (JTEMP) : Jurnal Ilmiah Teknologi Sistem Informasi is an international peer-reviewed open-access journal dedicated to interchange for the results of high-quality research in all aspects of Electromedical Engineering and Control System, The paper will be published this year.
If there is anything I can do to help, such as answering questions, or providing additional information, please let me know.

I hope to hear from you soon

Sincerely

LPPM Politeknik Bina Trada Semarang

Publisher
JTEMP : Jurnal Teknik Elektromedik Polbitrada 
https://journal.polbitrada.ac.id/index.php/Jtemp



Whats-App-Image-2023-10-18-at-11-00-16

 [INFO PENDAFTARAN KAMPUS KESEHATAN PMI KOTA SEMARANG]

Siapa nih yang punya cita-cita menjadi seorang tenaga kesehatan ? Berbicara mengenai Program Studi Kesehatan tentu kita tahu bahwa prodi ini adalah salah satu jurusan favorit di Indonesia dan juga merupakan cabang sains yang berkembang pesat dalam peradaban manusia.

  • Teknologi Bank Darah 
  • Rekam Medis & Informasi Kesehatan 
  • Teknik Elektromedik

Whats-App-Image-2023-11-18-at-10-44-43

Wujudkan cita-citamu bersama kami.

Penerimaan Mahasiswa Baru Program Diploma POLITEKNIK BINA TRADA SEMARANG Tahun 2023/2024.

Program Diploma bertujuan menghasilkan lulusan di bidang Kesehatan yang terkemuka , berkualitas, profesional dan mengabdi pada kepentingan kemanusiaan.

Jadi tunggu apa lagi ? mari bergabung dengan Prodi Kesehatan. Caranya gampang, #daftardarirumah saja dengan mengakses langsung website pmb.polbitrada.ac.id.

More info PMB :
website : polbitrada.ac.id
website pmb : pmb.polbitrada.ac.id

profile Kampus : youtube
Call centre WA : 08112920076


Mari TUMBUH dan BERKEMBANG bersama kami di POLBITRADA SEMARANG!

Dimmer Circuit

 The dimmer circuit is a circuit that functions to adjust the light intensity of the Light Emitting Diode (LED). In addition to adjusting the intensity of the LED, this circuit can basically also be used to adjust the speed of a DC motor.


This circuit is built from the basic principle of a pulse width modulator or PWM (Pulse Width Modulation) compared to a latch circuit.


LED lights are electronic components that function to emit light. This lamp is widely used in electronics projects because of its small size and energy saving and uses less power.


A standard LED lamp only requires a current of 10mA to 20mA with a working voltage of 2 to 3 volts.

PWM CIrcuit

The PWM circuit is a circuit that functions to adjust the width of a signal in the form of a digital pulse. This circuit will set the time period of the High Signal and Low Signal without affecting the frequency of the signal.


This High and Low period will later be compared with the logic level of the Latch and then used to adjust the intensity of the LED light.


The Latch circuit itself is a circuit that functions to hold an input value until the value is reset or changed. This circuit uses a Multivibrator component. The logic level of Latch will be compared with the PWM then the result will determine the intensity of the LED light.

 Material :

  • IC 555 (1)
  • IC 4013 (5)
  • IC AND Gate 7408 (1)
  • IC 4028 (1)
  • IC 7485 (1)
  • Diode 4148 (1)
  • Transistor NPN BC 337 (1)
  • Resistor 4K7 (2)
  • Resistor 10K (3)
  • Resistor 1K (2)
  • Kapasitor 100n (1)
  • Push button Switch (2)
  • LED 5mm (4)


Program Proteus can download here 




 




Download Bahan DisiNI


Install Proteus 8 Profesional 

1. Proteus Professional 8.12 - SP0 - 

2. Masukkan Password untuk extract

3. Jika Ingin menambahkan library external arduino ada di folder 

4. setelah selesai tutup aplikasi, Kemudian Buka dan install Update Proteus 8.12

     (Rapsberry Pi PICO) Can't See PORT On ARDUINO IDE


if you experience raspberry pi pico can't connect to the port but before it can
, you can do a hard reset.. look this picture before you plug on usb port just press reset button on raspberry pi pico. You will see a new disk drive appear called RPI-RP2.





download file flash nuke for pico https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html




Drag the flash_nuke.uf2 file to RPI-RP2.
The RPI-RP2 drive will disappear and a new disk drive
That's it, you're done!



 


this code for 

Artificial Neural Network for Identification MATLAB


Download Here


 


Download Bahan DisiNI


Install Proteus 8 Profesional 

1. Proteus Professional 8.5 - SP0 - DEMO

2. Masukkan Licence nya License Key

3. Jika Ingin menambahkan library external arduino ada di folder 

4. setelah selesai tutup aplikasi, Kemudian Buka dan install Update Proteus 8.5 SP0 DEMO to PRO


Serial Communication UART Raspberry Pico (SoftSerial) check this out

 Dalam posting ini kita akan menghasilkan sinyal gelombang gigi gergaji dan segitiga. Seperti yang Anda lihat di posting ini, dengan arduino kami telah menghasilkan sinyal gelombang sinus . Semua detail tentang PWM dan pengendaliannya akan Anda temukan di artikel sebelumnya.


Sekarang kita hanya akan membahas metode untuk membangkitkan kedua sinyal tersebut.

Contoh pertama:


Sinyal gigi gergaji pada 100Hz.


Sinyal PWM kami memiliki 31372Hz jadi, periode untuk frekuensi ini adalah T1=31,8us. Untuk 100Hz periodenya adalah T2=10ms jadi, T2/T1 =314 pulsa dari sinyal PWM di setiap siganl gigi gergaji pada 100Hz seperti pada gambar di bawah (adalah 31,8us bukan 318us).



Sekarang pulsa PWM harus memiliki siklus tugas yang meningkat. Program di bawah ini akan menghasilkan semua siklus kerja untuk setiap pulsa. Sebelum itu duty cycle maksimum adalah 255 sehingga duty cycle terakhir harus 255. Karena kita memiliki 314 pulsa dan duty cycle harus meningkat, kita memilih parameter yang dikalikan dengan duty cycle maksimum memberi kita duty cycle untuk pulsa yang ditentukan. Sekarang nilai maksimum untuk parameter tersebut pada pulsa ke-314 adalah 1 (1×255=255). Parameter mulai dari nol dan meningkat dengan 0,0031 (1/314 pulsa).



float x=0;
int y=0;
void setup() {
Serial.begin(9600);
}
// the loop  fungsi berjalan berulang-ulang selamanya
void loop() {
y=x*250; // hitung duty cycle (250 bukan 255 karena akan membantu mematikan //transistor)
delay(100);
//karena duty cycle maksimum adalah 250 berarti nilai maksimum untuk x adalah 1
// untuk sinyal 100Hz kami memiliki peningkatan 1/314 = 0,0031 langkah
x=x+0.0031;// memperbesar sudut
Serial.println(y);// pada monitor serial akan muncul siklus tugas antara 0 dan 90 //derajat
}


Hasil Akan ditampilkan pada Serial Monitor

Dari serialprint Anda harus mengambil nilai dari 0 hingga 250 tidak lebih besar dan memasukkannya ke dalam array. Dengan fungsi interupsi, program selanjutnya bergerak dalam array dan meningkatkan siklus kerja untuk setiap pulsa. Programnya adalah:


int i=0;// posisi di vektor mypwm
int m; // mengambil nilai dari vektor
int mypwm[]={0,1,2,3,3,4,5,6,6,7,8,9,10,11,12,13,14,15,16,17,17,18,19,20,20,21,22,23,24,25,26,27,27,28,29,30,31,31,32,
33,34,34,35,36,37,37,38,39,40,41,41,42,43,44,44,45,46,47,48,48,49,50,51,51,52,53,54,55,55,56,57,58,58,59,60,61,61,
62,63,64,65,65,66,67,68,68,69,70,71,72,72,73,74,75,75,76,77,78,79,79,80,81,82,82,83,84,85,86,86,87,88,89,89,90,91,
92,93,93,94,95,96,96,97,98,99,99,100,101,102,103,103,104,105,106,106,107,108,109,110,111,112,113,113,114,115,116,
117,117,118,119,120,120,121,122,123,124,124,125,126,127,127,128,129,130,130,131,132,133,134,135,136,137,137,138,
139,140,141,141,142,143,144,144,145,146,147,148,148,149,150,151,151,152,153,154,154,155,156,157,158,159,160,161,
161,162,163,164,165,165,166,167,168,168,169,170,171,172,172,173,174,175,175,176,177,178,179,179,180,181,182,183,
184,185,185,186,187,188,189,189,190,191,192,192,193,194,195,196,196,197,198,199,199,200,201,202,203,203,204,205,206,
206,207,208,209,210,210,211,212,213,213,214,215,216,216,217,218,219,220,220,221,222,223,223,224,225,226,227,227,228,
229,230,230,231,232,233,234,234,235,236,237,238,239,240,241,242,243,244,244,245,246,247,247,248,249};
// vektor mypwm berisi nilai siklus tugas
void setup() {

Serial.begin(9600);

pinMode(5, OUTPUT);

cli();// stop interrupts

TCCR0A=0;
TCCR0B=0;
TCNT0=0;
TCCR0A=0b10100001;// |= (1 << WGM00);//phase correct pwm mode
TCCR0B=0b00000001;// |= (1<< CS00);// //no prescaling

TCCR1A=0;
TCCR1B=0;
TCNT1=0;
OCR1A=510;// di sini kami telah menyinkronkan kedua timer (0 dan 1)
//0b izinkan saya menulis bit dalam biner
TCCR1B=0b00001001;// |=(1 << WGM12);
//TCCR1B |= (1 << CS10);//0b00001010;// fara prescaler
TIMSK1 |=(1 << OCIE1A);

sei();
}

ISR(TIMER1_COMPA_vect){
if(i>(312)){//adalah n-1 karena vektor berindeks nol
i=0; // kami hanya memiliki 313 elemen dalam array karena dengan cara ini kami //memiliki tepat 100.00Hz osiloskop
}
m=mypwm[i];// variabel m mengambil nilai dari vektor
i=i+1; // meningkatkan posisi dalam vektor
OCR0B=m;// pin 5 pada pwm dengan siklus tugas dari vektor
}
void loop() {

}


Hasil Akan ditampilkan pada Pin 5

Gelombang segitiga pada 100Hz. Untuk gelombang segitiga seperti untuk gelombang sinus, setengah dari pulsa meningkat dan setengah lainnya berkurang. Jadi program berikutnya memberi kita siklus tugas untuk gelombang segitiga 100Hz:


float x=0;
int y=0;
double OK=false;
void setup() {
Serial.begin(9600);
}
// fungsi loop berjalan berulang-ulang selamanya
void loop() {
y=x*250; // hitung duty cycle (250 bukan 255 karena akan membantu mematikan //transistor)
delay(100);
//because the maximum duty cycle is 250 means that maximum value for x is 1
// for a 100Hz signal we have 1/314=0.0031 increasing step
if(x<0.5 &&OK==false){
x=x+0.0031;// increase the angle on the half of the signal
}
if(x>0.5){//middle of the signal
OK=true;
}
if(OK==true){
x=x-0.0031;// decrease the angle on the other half of the signal
}
Serial.println(y);// pada monitor serial akan muncul siklus tugas antara 0 dan 90 //derajat
}



Program untuk gelombang segitiga adalah:


float x=0;
int y=0;
double OK=false;
void setup() {
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
y=x*250; // calculate duty cycle(250 not 255 because will help to turn off transistors)
delay(100);
//because the maximum duty cycle is 250 means that maximum value for x is 1
// for a 100Hz signal we have 1/314=0.0031 increasing step
if(x<0.5 &&OK==false){
x=x+0.0031;// increase the angle on the half of the signal
}
if(x>0.5){//middle of the signal
OK=true;
}
if(OK==true){
x=x-0.0031;// decrease the angle on the other half of the signal
}
Serial.println(y);// on the serial monitor will appear duty cycles between 0 and 90 deg
}

The program for the triangle waves is:

int i=0;// position in mypwm vector
int m; // takes values from vector
int mypwm[]={0,1,2,3,3,4,5,6,6,7,8,9,10,11,12,13,14,15,16,17,17,18,19,20,20,21,22,23,24,25,26,27,27,28,29,30,31,31,32,
33,34,34,35,36,37,37,38,39,40,41,41,42,43,44,44,45,46,47,48,48,49,50,51,51,52,53,54,55,55,56,57,58,58,59,60,61,61,
62,63,64,65,65,66,67,68,68,69,70,71,72,72,73,74,75,75,76,77,78,79,79,80,81,82,82,83,84,85,86,86,87,88,89,89,90,91,
92,93,93,94,95,96,96,97,98,99,99,100,101,102,103,103,104,105,106,106,107,108,109,110,111,112,113,113,114,115,116,
117,117,118,119,120,120,121,122,123,124,124,124,124,123,122,121,120,120,119,118,117,117,116,115,114,113,113,112,111,
110,110,109,108,107,106,106,105,104,103,103,102,101,100,99,99,98,97,96,96,95,94,93,93,92,91,90,89,89,88,87,86,86,85,
84,83,82,82,81,80,79,79,78,77,76,75,75,74,73,72,72,71,70,69,68,68,67,66,65,65,64,63,62,61,61,60,59,58,58,57,56,55,55,
54,53,52,51,51,50,49,48,48,47,46,45,44,44,43,42,41,41,40,39,38,37,37,36,35,34,34,33,32,31,31,30,29,28,27,27,26,25,24,
24,23,22,21,20,20,19,18,17,17,16,15,14,13,13,12,11,10,10,9,8,7,6,6,5,4,3,3,2,1,0};
// mypwm vector contains duty cycle values
void setup() {

Serial.begin(9600);

pinMode(5, OUTPUT);

cli();// stop interrupts

TCCR0A=0;
TCCR0B=0;
TCNT0=0;
TCCR0A=0b10100001;// |= (1 << WGM00);//phase correct pwm mode
TCCR0B=0b00000001;// |= (1<< CS00);// //no prescaling

TCCR1A=0;
TCCR1B=0;
TCNT1=0;
OCR1A=510;// here we have sincronized both timers (0 and 1)
//0b allow me to write bits in binary
TCCR1B=0b00001001;// |=(1 << WGM12);
//TCCR1B |= (1 << CS10);//0b00001010;// fara prescaler
TIMSK1 |=(1 << OCIE1A);

sei();
}

ISR(TIMER1_COMPA_vect){
if(i>(312)){// is n-1 because the vector is zero indexed
i=0; // we have only 313 elements in the array because in this way we have
// exactly 100.00Hz oscilloscope
}
m=mypwm[i];// the variable m takes values from vector
i=i+1; // increase the position in vector
OCR0B=m;// pin 5 on pwm with duty cycle from vector
}
void loop() {

}



Hasil Akan ditampilkan pada PIN 5

 Bagaimana cara menggunakan DHT 21 atau biasa disebut dengan AMS 2301. Ini adalah modul sensor suhu dan kelembaban yang lebih baik daripada DHT 11. DHT 11 cukup bagus, tapi banyak keterbatasan, diantaranya adalah DHT 11 tidak bisa mengukur nilai suhu negatif. Mengapa kita menggunakan DHT 21? Pengukuran sangat akurat, kabel sensor bisa panjang, dan bisa mengukur nilai suhu negatif


Data Sheet DHT21 




PROGRAM Menampilkan Hasil suhu dari Dht21



#include <DHT.h>; // Memanggil library DHT

#define DHTPIN 8            // PIN data DHT 21
#define DHTTYPE DHT21       // Jenis DHT 21  (AM2301)
DHT dht(DHTPIN, DHTTYPE);   // Inisialisasi sensor DHT

float hum;  // Variable penyimpanan nilai kelembaban
float temp; // Variable penyimpanan nilai suhu

void setup()
{
  Serial.begin(9600); // Baud rate komunikasi 
  dht.begin(); // Memulai DHT
}

void loop()
{
  hum = dht.readHumidity(); // Menyimpan hasil pembacaan kelembaban
  temp= dht.readTemperature(); // Menyimpan hasil pembacaan suhu

  // Menyajikan hasil pembacaan suhu dan kelembaban
  Serial.print("Suhu : ");
  Serial.print(temp);
  //Serial.print(°);
  Serial.print(" °C | Kelembaban : ");
  Serial.print(hum);
  Serial.println(" %");
  
  delay(2000); //Delay 2 detik
}


Hasil Akan ditampilkan pada Serial Monitor
Newer Posts Older Posts Home





POPULAR POSTS

  • Skema Power Supply Switching SMPS
  • Proteus 8.5 Full Version Professional
  • Artificial Neural Network for Identification MATLAB
  • Tutorial ILI9341 TFT SPI LCD touch Screen
  • Serial Communication UART Raspberry Pico (SoftSerial)
  • Pulse Oxymetry (SPO2) + Raspberry Pi
  • Menampilkan Text Pada LCD 16x2 I2C Arduino

ABOUT ME

cobabaru

Sinau Programming

SUBSCRIBE & FOLLOW

Training


Contact Form

Name

Email *

Message *

Categories

  • alkes 1
  • Android 4
  • Arduino 35
  • Basic & Doc 12
  • centrifuge 1
  • ESP32 8
  • Internet of Things (IoT) 23
  • LCD TFT SPI 2
  • MATLAB 6
  • Metode kendali 1
  • Modul Charger 1
  • Nextion 4
  • NodeMcu 8
  • oled 1
  • Pattern Recognition 2
  • Pemrograman 2
  • Perbaikan 1
  • PID 2
  • PLC HMI VTSCADA ARDUINO 3
  • PRIVACY POLICY 1
  • Proteus 11
  • Python 1
  • raspberry 5
  • Teknik Elektromedik 2
  • Thingsboard 1
  • Video 5
  • Wemos 4

sinau_programming

Sinau Programming Distributed by Sinau Programming