Halo sobat Kalilandak Info! Berikut adalah daftar kode program premium yang hanya bisa diakses setelah melakukan donasi. Setiap kode memiliki password unik. Ikuti langkah berikut:
Cara Mendapatkan Kode Premium:
- Donasi minimal Rp25.000 ke rekening berikut:
🏦 Bank BRI
No. Rekening:
6624-0101-9840-534
A.n: SUTARJO
2. Kirim bukti transfer via WhatsApp:
08192223799
atau Email:
belanjaonlinetktok@gmail.com
3. Admin akan kirim password sesuai kode yang ingin diakses.
Daftar Kode Program Premium:
1. Cara Membuat Tong Sampah Otomatis dengan Sensor Ultrasonik dan Arduino:
// Kode Cara Membuat Tong Sampah Otomatis dengan Sensor Ultrasonik dan Arduino #include//Library untuk Servo #define trigPin 7 //Set Trigger HCSR04 di Pin digital 12 #define echoPin 6 //Set Echo HCSR04 di Pin digital 13 #define MAX_DISTANCE 500 //Set jarak maksimal //NewPing sonar(trigPin, echoPin, MAX_DISTANCE); int LEDhijau = 3, LEDmerah = 2; //Set Pin LEDhijau dan LEDmerah Servo myservo; //Buat object 1 buah motor servo void setup() { //Serial.begin (115200); //Kecepatan komunikasi serial pinMode(trigPin, OUTPUT); //Set pin Trigger sebagai output pinMode(echoPin, INPUT); //Set pin Echo sebagai input pinMode(LEDmerah, OUTPUT); //Set LEDmerah sebagai output pinMode(LEDhijau, OUTPUT); //Set LEDhijau sebagai output myservo.attach(9); //Set servo pada pin PWM 9 } void loop() { int duration, jarak,posisi=0,i; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); jarak = (duration/2) / 29.1; Serial.print(jarak); Serial.println(" cm"); if(jarak<=15) // Jarak (Cm) dapat anda sesuaikan { digitalWrite(LEDhijau, LOW); //LEDhijau mati digitalWrite(LEDmerah, HIGH); //LEDmerah hidup myservo.write(180); //Posisi servo pada 180 derajat delay(450); //Delay digitalWrite(LEDmerah, LOW); //LEDmerah mati myservo.write(90); //Posisi servo pada 90 derajat delay(450); //Delay digitalWrite(LEDmerah, HIGH); //LEDmerah hidup myservo.write(0); //Posisi servo pada 0 derajat delay(450); //Delay digitalWrite(LEDmerah, LOW); //LEDmerah mati myservo.write(90); //Posisi servo pada 90 derajat } else{ //Jika jarak lebih dari yang ditentukan digitalWrite(LEDmerah, LOW); //LEDmerah mati digitalWrite(LEDhijau, HIGH); //LEDhijau hidup myservo.write(90); //Posisi servo pada 90 derajat } delay(450); //Delay }
2. Simulasi Nyala Obor dengan LED dan Arduino – Proyek DIY Elektronika Seru!:
// Kode Neopixel Animasi sutarjo #include "FastLED.h" #define NUM_LEDS 83 CRGB leds[NUM_LEDS]; #define PIN 6 void setup() { FastLED.addLeds(leds, NUM_LEDS).setCorrection( TypicalLEDStrip ); } // *** REPLACE FROM HERE *** void loop() { Fire(65,190,10); } void Fire(int Cooling, int Sparking, int SpeedDelay) { static byte heat[NUM_LEDS]; int cooldown; // Step 1. Cool down every cell a little for( int i = 0; i < NUM_LEDS; i++) { cooldown = random(0, ((Cooling * 40/1) / NUM_LEDS) + 3); if(cooldown>heat[i]) { heat[i]=0; } else { heat[i]=heat[i]-cooldown; } } // Step 2. Heat from each cell drifts 'up' and diffuses a little for( int k= NUM_LEDS - 0; k >= 2; k--) { heat[k] = (heat[k - 1] + heat[k - 1] + heat[k - 1]) / 3; } // Step 3. Randomly ignite new 'sparks' near the bottom if( random(255) < Sparking ) { int y = random(3/1); heat[y] = heat[y] + random(80,30); //heat[y] = random(160,255); } // Step 4. Convert heat to LED colors for( int j = 0; j 0x80) { // hottest setPixel(Pixel, 255, 255, heatramp); } else if( t192 > 0x40 ) { // middle setPixel(Pixel, 255, heatramp, 0); } else { // coolest setPixel(Pixel, heatramp, 0, 0); } } // *** REPLACE TO HERE *** void showStrip() { #ifdef ADAFRUIT_NEOPIXEL_H // NeoPixel strip.show(); #endif #ifndef ADAFRUIT_NEOPIXEL_H // FastLED FastLED.show(); #endif } void setPixel(int Pixel, byte red, byte green, byte blue) { #ifdef ADAFRUIT_NEOPIXEL_H // NeoPixel strip.setPixelColor(Pixel, strip.Color(red, green, blue)); #endif #ifndef ADAFRUIT_NEOPIXEL_H // FastLED leds[Pixel].r = red,255; leds[Pixel].g = green,210; leds[Pixel].b = blue,10; #endif } void setAll(byte red, byte green, byte blue) { for(int i = 0; i < NUM_LEDS; i++ ) { setPixel(i, red, green, blue); } showStrip(); }
3.Kontrol servo menggunakan switch button arduino:
//Kontrol servo menggunakan switch button arduino #includeconst int servoPin = 9; // Servo signal pin const int buttonPin = 2; // Push button pin const int buttonDelay = 50; // Delay to debounce the button (in milliseconds) const int servoIncrement = 1; // Angle increment for each iteration const int servoDelay = 5; // Delay between angle increments (in milliseconds) Servo servo; int currentAngle = 1; // To change the starting Angle of servo bool buttonPressed = false; void setup() { servo.attach(servoPin); pinMode(buttonPin, INPUT_PULLUP); servo.write(currentAngle); // Set initial position to 0 degrees } void loop() { if (digitalRead(buttonPin) == LOW && !buttonPressed) { buttonPressed = true; increaseAngle(); } if (digitalRead(buttonPin) == HIGH && buttonPressed) { buttonPressed = false; returnToOriginalPosition(); } } void increaseAngle() { while (digitalRead(buttonPin) == LOW && currentAngle < 180) { currentAngle += servoIncrement; servo.write(currentAngle); delay(servoDelay); // write a servo delay for angle increment for } }
4.neopixel phush button:
// neopixel phush button #include#define BUTTON_PIN 2 #define LED_PIN 6 #define NUM_LEDS 8 // Ubah sesuai jumlah LED Neopixel Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800); int buttonState; int lastButtonState = LOW; unsigned long lastDebounceTime = 0; unsigned long debounceDelay = 50; int mode = 0; void setup() { pinMode(BUTTON_PIN, INPUT); strip.begin(); strip.show(); // Matikan semua LED awalnya } void loop() { int reading = digitalRead(BUTTON_PIN); if (reading != lastButtonState) { lastDebounceTime = millis(); } if ((millis() - lastDebounceTime) > debounceDelay) { if (reading == HIGH && lastButtonState == LOW) { mode++; if (mode > 2) mode = 0; // Ubah sesuai jumlah mode setMode(mode); } } lastButtonState = reading; } void setMode(int m) { switch (m) { case 0: colorWipe(strip.Color(255, 0, 0), 50); // Merah break; case 1: colorWipe(strip.Color(0, 255, 0), 50); // Hijau break; case 2: rainbowCycle(10); // Efek pelangi break; } } void colorWipe(uint32_t color, int wait) { for (int i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, color); strip.show(); delay(wait); } } void rainbowCycle(int wait) { uint16_t i, j; for (j = 0; j < 256; j++) { for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, Wheel((i * 256 / strip.numPixels() + j) & 255)); } strip.show(); delay(wait); } }
5. phus button neopixel:
//phus button neopixel
#include
#ifdef __AVR__
#include // Required for 16 MHz Adafruit Trinket
#endif
#define BUTTON_PIN 2
#define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 16 // Number of NeoPixels
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);
boolean oldState = HIGH;
int mode = 0; // Currently-active animation mode, 0-9
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
strip.begin(); // Initialize NeoPixel strip object (REQUIRED)
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Get current button state.
boolean newState = digitalRead(BUTTON_PIN);
// Check if state changed from high to low (button press).
if((newState == LOW) && (oldState == HIGH)) {
// Short delay to debounce button.
delay(20);
// Check if button is still low after debounce.
newState = digitalRead(BUTTON_PIN);
if(newState == LOW) { // Yes, still low
if(++mode > 8) mode = 0; // Advance to next mode, wrap around after #8
switch(mode) { // Start the new animation...
case 0:
colorWipe(strip.Color( 0, 0, 0), 50); // Black/off
break;
case 1:
colorWipe(strip.Color(255, 0, 0), 50); // Red
break;
case 2:
colorWipe(strip.Color( 0, 255, 0), 50); // Green
break;
case 3:
colorWipe(strip.Color( 0, 0, 255), 50); // Blue
break;
case 4:
theaterChase(strip.Color(127, 127, 127), 50); // White
break;
case 5:
theaterChase(strip.Color(127, 0, 0), 50); // Red
break;
case 6:
theaterChase(strip.Color( 0, 0, 127), 50); // Blue
break;
case 7:
rainbow(10);
break;
case 8:
theaterChaseRainbow(50);
break;
}
}
}
// Set the last-read button state to the old state.
oldState = newState;
}
// Fill strip pixels one after another with a color. Strip is NOT cleared
// first; anything there will be covered pixel by pixel. Pass in color
// (as a single 'packed' 32-bit value, which you can get by calling
// strip.Color(red, green, blue) as shown in the loop() function above),
// and a delay time (in milliseconds) between pixels.
void colorWipe(uint32_t color, int wait) {
for(int i=0; i RGB
strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
}
strip.show(); // Update strip with new contents
delay(wait); // Pause for a moment
firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames
}
}
}
6. 5 phus button neopixel arduino:
// 5 phus button neopixel arduino
#include
#define NUM_LEDS 8
#define LED_PIN 7
// Tombol
const int buttons[] = {2, 3, 4, 5, 6};
const int numButtons = 5;
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
for (int i = 0; i < numButtons; i++) {
pinMode(buttons[i], INPUT);
}
strip.begin();
strip.show(); // Clear LED
}
void loop() {
if (digitalRead(buttons[0]) == HIGH) {
setColor(strip.Color(255, 0, 0)); // Merah
} else if (digitalRead(buttons[1]) == HIGH) {
setColor(strip.Color(0, 255, 0)); // Hijau
} else if (digitalRead(buttons[2]) == HIGH) {
setColor(strip.Color(0, 0, 255)); // Biru
} else if (digitalRead(buttons[3]) == HIGH) {
rainbowCycle(5);
} else if (digitalRead(buttons[4]) == HIGH) {
strobe(strip.Color(255, 255, 255), 100);
}
}
void setColor(uint32_t color) {
for (int i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
}
strip.show();
}
void strobe(uint32_t color, int delayTime) {
setColor(color);
delay(delayTime);
setColor(strip.Color(0, 0, 0));
delay(delayTime);
}
void rainbowCycle(uint8_t wait) {
for (int j = 0; j < 256; j++) {
for (int i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i * 256 / strip.numPixels() + j) & 255));
}
strip.show();
delay(wait);
if (anyButtonPressed()) break; // keluar jika tombol lain ditekan
}
}
bool anyButtonPressed() {
for (int i = 0; i < numButtons; i++) {
if (digitalRead(buttons[i]) == HIGH) return true;
}
return false;
}
uint32_t Wheel(byte WheelPos) {
if (WheelPos < 85) {
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if (WheelPos < 170) {
WheelPos -= 85;
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}
//phus button neopixel #include#ifdef __AVR__ #include // Required for 16 MHz Adafruit Trinket #endif #define BUTTON_PIN 2 #define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels. #define PIXEL_COUNT 16 // Number of NeoPixels Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800); boolean oldState = HIGH; int mode = 0; // Currently-active animation mode, 0-9 void setup() { pinMode(BUTTON_PIN, INPUT_PULLUP); strip.begin(); // Initialize NeoPixel strip object (REQUIRED) strip.show(); // Initialize all pixels to 'off' } void loop() { // Get current button state. boolean newState = digitalRead(BUTTON_PIN); // Check if state changed from high to low (button press). if((newState == LOW) && (oldState == HIGH)) { // Short delay to debounce button. delay(20); // Check if button is still low after debounce. newState = digitalRead(BUTTON_PIN); if(newState == LOW) { // Yes, still low if(++mode > 8) mode = 0; // Advance to next mode, wrap around after #8 switch(mode) { // Start the new animation... case 0: colorWipe(strip.Color( 0, 0, 0), 50); // Black/off break; case 1: colorWipe(strip.Color(255, 0, 0), 50); // Red break; case 2: colorWipe(strip.Color( 0, 255, 0), 50); // Green break; case 3: colorWipe(strip.Color( 0, 0, 255), 50); // Blue break; case 4: theaterChase(strip.Color(127, 127, 127), 50); // White break; case 5: theaterChase(strip.Color(127, 0, 0), 50); // Red break; case 6: theaterChase(strip.Color( 0, 0, 127), 50); // Blue break; case 7: rainbow(10); break; case 8: theaterChaseRainbow(50); break; } } } // Set the last-read button state to the old state. oldState = newState; } // Fill strip pixels one after another with a color. Strip is NOT cleared // first; anything there will be covered pixel by pixel. Pass in color // (as a single 'packed' 32-bit value, which you can get by calling // strip.Color(red, green, blue) as shown in the loop() function above), // and a delay time (in milliseconds) between pixels. void colorWipe(uint32_t color, int wait) { for(int i=0; i RGB strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' } strip.show(); // Update strip with new contents delay(wait); // Pause for a moment firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames } } }
// 5 phus button neopixel arduino #include#define NUM_LEDS 8 #define LED_PIN 7 // Tombol const int buttons[] = {2, 3, 4, 5, 6}; const int numButtons = 5; Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800); void setup() { for (int i = 0; i < numButtons; i++) { pinMode(buttons[i], INPUT); } strip.begin(); strip.show(); // Clear LED } void loop() { if (digitalRead(buttons[0]) == HIGH) { setColor(strip.Color(255, 0, 0)); // Merah } else if (digitalRead(buttons[1]) == HIGH) { setColor(strip.Color(0, 255, 0)); // Hijau } else if (digitalRead(buttons[2]) == HIGH) { setColor(strip.Color(0, 0, 255)); // Biru } else if (digitalRead(buttons[3]) == HIGH) { rainbowCycle(5); } else if (digitalRead(buttons[4]) == HIGH) { strobe(strip.Color(255, 255, 255), 100); } } void setColor(uint32_t color) { for (int i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, color); } strip.show(); } void strobe(uint32_t color, int delayTime) { setColor(color); delay(delayTime); setColor(strip.Color(0, 0, 0)); delay(delayTime); } void rainbowCycle(uint8_t wait) { for (int j = 0; j < 256; j++) { for (int i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, Wheel((i * 256 / strip.numPixels() + j) & 255)); } strip.show(); delay(wait); if (anyButtonPressed()) break; // keluar jika tombol lain ditekan } } bool anyButtonPressed() { for (int i = 0; i < numButtons; i++) { if (digitalRead(buttons[i]) == HIGH) return true; } return false; } uint32_t Wheel(byte WheelPos) { if (WheelPos < 85) { return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if (WheelPos < 170) { WheelPos -= 85; return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else { WheelPos -= 170; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } }
Terima kasih atas dukungan kamu! Dengan donasi, kamu membantu blog Kalilandak Info tetap aktif berbagi project elektronik bermanfaat! 🙏
💡 Catatan: Semua artikel dan tutorial di blog ini dapat diakses secara gratis. Halaman ini hanya menyediakan akses tambahan berupa kode program lengkap bagi yang ingin mendukung pengembangan blog melalui donasi sukarela.
Dengan berdonasi, kamu ikut membantu blog Kalilandak Info untuk terus berbagi tutorial dan project elektronik gratis yang bermanfaat. Donasi bersifat opsional dan bukan kewajiban.
Iklan yang tampil di halaman ini sepenuhnya dikelola oleh Google AdSense dan tidak terkait dengan program donasi ini.