1
ไมโครคอนโทรลเลอร์ (Arduino) / Re: ลายปริ้นวงจรบอร์ดทดลองไมโครคอนโทรลเลอร์เวอร์ชั่น 2025
« เมื่อ: กันยายน 17, 2025, 10:08:17 PM »
วงจรการเชื่อมต่อโมดูลต่าง ๆ



















This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2); /* 0x27 for PCF8574 and 0x3F for PCF8574A*/
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(2,0);
lcd.print("Hello, world!");
lcd.setCursor(4,1);
lcd.print("LCD i2c Lab");
}
void loop()
{
}
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C //Address OLED
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
int x;
void setup() {
Serial.begin(9600);
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
}
void loop(){
display.clearDisplay();
display.setTextColor(WHITE,BLACK); //Text is white ,background is black
display.setCursor(0, 0);
display.setTextSize(2);
display.println("OLED ");
display.setTextSize(1);
display.println("Arduino Laboratory");
display.setTextColor(BLACK,WHITE); // 'inverted' text
display.print("www.praphas.com");
display.setTextColor(WHITE,BLACK); // 'inverted' text again
display.setCursor(60,0);
display.setTextSize(2);
display.println(x,DEC);
display.display(); //
x++;
delay(250);
}
/* pin connection
+ -> 3.3-5V
- -> GND
D -> SDA (A4)
C -> SCL (A5)
*/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment display = Adafruit_7segment();
void setup() {
display.begin(0x70);
display.clear();
}
void loop() {
byte x, y, d;
bool blinkColon = false;
display.println("Abcd");
display.writeDisplay();
delay(5000);
for (int i = 0; i < 99; i++) {
display.println(i);
display.writeDisplay();
delay(50);
}
for (float f = 0; f < 5; f += 0.01) {
display.println(f);
display.writeDisplay();
delay(50);
}
for (float f = 10; f < 50; f += 0.1) {
x = int(f) / 10;
y = int(f) % 10;
d = int(f * 10) % 10;
display.println(" C");
display.writeDigitNum(0, x, false);
display.writeDigitNum(1, y, true);
display.writeDigitNum(3, d, false);
display.writeDisplay();
delay(50);
}
for (int i = 0; i < 10; i++) {
display.println(1234);
blinkColon = !blinkColon;
display.drawColon(blinkColon);
display.writeDisplay();
delay(1000);
}
}
#include <Keypad.h>
#define LED 5
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {6,7,8,9}; // Pins connected to R1, R2, R3, R4
byte colPins[COLS] = {10,11,12}; // Pins connected to C1, C2, C3
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
Serial.begin(9600);
pinMode(LED,OUTPUT);
}
void loop()
{
char key = keypad.getKey();
if (key)
{
Serial.println(key);
digitalWrite(LED,HIGH);delay(200);
digitalWrite(LED,LOW);
}
}
#include <LiquidCrystal.h>
/* The circuit:
* LCD RS pin to digital pin 13
* LCD E pin to digital pin 12
* LCD D4 pin to digital pin 4
* LCD D5 pin to digital pin 5
* LCD D6 pin to digital pin 6
* LCD D7 pin to digital pin 7
* LCD R/W pin to ground
*/
LiquidCrystal lcd(13,12,4,5,6,7); // set up the LCD's connection pins
void setup()
{
lcd.begin(16, 2); // set LCD size
lcd.print("hello, world!");
}
void loop() {}
#include "LedControl.h"
LedControl lc=LedControl(11,13,10,1); // 11->DIN,13->CLK,10->CS,1->1devices
void setup()
{
lc.shutdown(0, false); // Enable display
lc.setIntensity(0, 5); // Set brightness level (0 is min, 15 is max)
lc.clearDisplay(0); // Clear display register
Serial.begin(9600);
}
void loop()
{
byte x, y, z;
int i;
for (i = 0; i < 1000; i++)
{
Serial.println("--" + String(i));
x = i / 100; //hundred digits
y = (i % 100) / 10; //tens digit
z = i % 10; //unit digit
lc.setDigit(0, 3, x, false);
lc.setDigit(0, 2, y, false);
lc.setDigit(0, 1, z, false);
delay(100);
}
}
วงจรเชื่อมต่อในบอร์ดทดลอง | เชื่อมต่อไว้แล้ว | ผู้ใช้งานเชื่อมต่อเอง |
---|---|---|
วงจรเซนเซอร์อุณหภูมิ LM35 | - | ✅ |
วงจรเซนเซอร์แสง LDR | - | ✅ |
วงจรเซนเซอร์อุณหภูมิ NTC | - | ✅ |
วงจรเซนเซอร์อุณหภูมิ DS18B20 | - | ✅ |
วงจร 10 bit LED | - | ✅ |
วงจร DC Motor | - | ✅ |
วงจร Stepper Motor | - | ✅ |
วงจร Servo Motor | - | ✅ |
วงจรเซนเซอร์อุณหภูมิ DHT11 | - | ✅ |
วงจรสวิตช์เอาต์พุตดิจิทัล | - | ✅ |
วงจรสวิตช์เอาต์พุตแอนะล็อก | - | ✅ |
วงจรแสดงผล 7 Segment 4 หลัก | - | ✅ |
วงจรแสดงผล 7 Segment ชิพ TM1637 | - | ✅ |
วงจรแสดงผล 7 Segment ชิพ 74HC595 | - | ✅ |
วงจรกำเนิดค่าแรงดันแอนะล็อก (Potentiometer) | - | ✅ |
วงจรอุณหภูมิระยะทาง Ultrasonic | - | ✅ |
วงจรแสดงผล 7 Segment ชิพ MAX7219 | ✅ | - |
วงจร LCD | ✅ | - |
วงจร Keypad | ✅ | - |
วงจรแสดงผล 7 Segment ชิพ HT16K33(i2c) | ✅ | - |
วงจรแสดงผล OLED i2c | ✅ | - |
วงจรแสดงผล LCD 16x2 i2c | ✅ | - |