- Megjött a Razer DeathAdder egerek legfrissebb nemzedéke
- Ismét minimalista miditorony érkezett a Fractal Design műhelyéből
- Alakul a SpaceX Starlink európai ellenfele
- Digital Fingerprinting: Így buktat le a böngésződ a neten - Tech Percek #18
- Prezentálta PCI Express 6.0-s SSD-vezérlőjét a Silicon Motion
- Gaming notebook topik
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- OLED TV topic
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Milyen alaplapot vegyek?
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- Házi barkács, gányolás, tákolás, megdöbbentő gépek!
- Mikrokontrollerek Arduino környezetben (programozás, építés, tippek)
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
lajbi30
csendes tag
válasz
dave0825 #1262 üzenetére
//Sample using LiquidCrystal library
#include <LiquidCrystal.h>/*******************************************************
This program will test the LCD panel and the buttons of
the DFRobot LCD Keypad Shield for Arduino
Product code : RB-Dfr-07
http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino-1.htmlNote cct error identified by Arduino forum discussion at:
http://arduino.cc/forum/index.php/topic,96747.0.html
which advises insertion of a Germanium 1n34a or a Schotky 1N5819
diode between pin 10 and the base of Q1 (K to pin 10).sample code originally by Mark Bramwell, July 2010
modifications by Dion Weston, March 2012********************************************************/
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);// define some values used by the panel and buttons
int backLight = 10; // LCD Panel Backlight LED connected to digital pin 10
int lightLevel = 255; // Initialise light full on
int lcd_key = 0;
int adc_key_in = 0;
#define btnRIGHT 0
#define btnUP 1
#define btnDOWN 2
#define btnLEFT 3
#define btnSELECT 4
#define btnNONE 5// read the buttons
int read_LCD_buttons()
{
adc_key_in = analogRead(0); // read the value from the sensor
// my [Mark Bramwell's] buttons when read are centered at these valies: 0, 144, 329, 504, 741
// we add approx 50 to those values and check to see if we are close
if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
if (adc_key_in < 50) return btnRIGHT;
if (adc_key_in < 195) return btnUP;
if (adc_key_in < 380) return btnDOWN;
if (adc_key_in < 555) return btnLEFT;
if (adc_key_in < 790) return btnSELECT;
return btnNONE; // when all others fail, return this...
}void setup()
{
lcd.begin(16, 2); // start the LCD library
lcd.setCursor(0,0); // move cursor to beginning of line "0"
lcd.print("Backlight adjust"); // print a simple message}
void loop()
{
analogWrite(backLight, lightLevel);
lcd.setCursor(13,1); // move to position 13 on the second line
lcd.print(lightLevel);lcd.setCursor(0,1); // move to the begining of the second line
lcd_key = read_LCD_buttons(); // read the buttonsswitch (lcd_key) // depending on which button was pushed, we perform an action
{
case btnRIGHT:
{
lcd.print("LED On ");
lightLevel = 255;
break;
}
case btnLEFT:
{
lcd.print("LED Off ");
lightLevel = 1;
break;
}
case btnUP:
{
lcd.print("LED Fade Up ");
if (lightLevel < 255) lightLevel += 1;
break;
}
case btnDOWN:
{
lcd.print("LED Fade Down ");
if (lightLevel > 1) lightLevel -= 1;
break;
}
case btnSELECT:
{
lcd.print("Select ");
break;
}
case btnNONE:
{
lcd.print(" ");
break;
}
}}
Kilyelző fényerejének változtatása
Új hozzászólás Aktív témák
- Mr Dini: Mindent a StreamSharkról!
- Tőzsde és gazdaság
- Gaming notebook topik
- Posta, csomagküldés
- Amazon
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- A fociról könnyedén, egy baráti társaságban
- Okos Otthon / Smart Home
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- MIUI / HyperOS topik
- További aktív témák...
- Asztali PC , i7 6700K , 1080 Ti 11GB , 32GB DDR4 , 500GB NVME , 500GB HDD
- Asztali PC , R5 8400F , RTX 3070 , 32GB DDR5 , 500GB NVME , 2TB HDD
- Legion Go 1TB
- Lenovo LOQ 15IRX9 - i5 13450HX, 16GB, RTX 4060 8G, 1TB M.2 (Gari: 2027.03.11.)
- LG 34WR55QK-B - 34" Ívelt VA - 3440x1440 - 100Hz 5ms - FreeSync Premium - HDR 10 - USB Type-C 65W
- ÁRGARANCIA!Épített KomPhone i5 13400F 16/32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
- AKCIÓ! MSI B450 R5 5500 16GB DDR4 512GB SSD RTX 2060 Super 8GB GDDR6 Rampage Shiva Zalman 500W
- BESZÁMÍTÁS! ÚJ AMD Ryzen 8500G / 8600G AMD Ryzen 7 8700G / 7800X3D processzor 3 év garancia 27% áfa
- KATONAI ÜTÉSÁLLÓ!!! Getac S410 i5-6300u, G3: i5-8365u, G4: i5-1145G7
- 134 - Lenovo Legion Pro 7 (16IRX8H) - Intel Core i9-13900HX, RTX 4090
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest