Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD RGB code with Arduino

License: Public Domain

Mode: Editors' pick

  • 1k
  • 0
  • 2
Update time: 2021-05-03 17:39:39
Creation time: 2019-01-14 15:16:20
Description
Program: #include LiquidCrystal_I2C lcd(0x27, 16, 2); int rosso = 11; int verde = 10; int blu = 9; int pUno = 7; int pDieci = 6; int pCento = 5; int pAvanti = 4; int pOK = 3; int pReset = 2; int valUno = 0; int valDieci = 0; int valCento = 0; int valAvanti = 0; int valOK = 0; int valReset = 0; int colore = 0; int valRosso = 0; int valVerde = 0; int valBlu = 0; void setup() { pinMode(rosso, OUTPUT); pinMode(verde, OUTPUT); pinMode(blu, OUTPUT); pinMode(pUno, INPUT); pinMode(pDieci, INPUT); pinMode(pCento, INPUT); pinMode(pAvanti, INPUT); pinMode(pOK, INPUT); pinMode(pReset, INPUT); lcd.init(); lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("R:"); lcd.setCursor(7, 0); lcd.print("G:"); lcd.setCursor(0, 1); lcd.print("B:"); } void loop() { valUno = digitalRead(pUno); valDieci = digitalRead(pDieci); valCento = digitalRead(pCento); valAvanti = digitalRead(pAvanti); valOK = digitalRead(pOK); valReset = digitalRead(pReset); if (valAvanti == 1) { colore = colore + 1; delay(300); } if (colore >= 3) { colore = 0; } if (valRosso >= 256) { valRosso = 0; lcd.setCursor(3, 0); lcd.print(" "); } if (valVerde >= 256) { valVerde = 0; lcd.setCursor(10, 0); lcd.print(" "); } if (valBlu >= 256) { valBlu = 0; lcd.setCursor(3, 1); lcd.print(" "); } if (colore == 0 and valUno == 1) { valRosso = valRosso + 1; delay(300); } if (colore == 0 and valDieci == 1) { valRosso = valRosso + 10; delay(300); } if (colore == 0 and valCento == 1) { valRosso = valRosso + 100; delay(300); } if (colore == 1 and valUno == 1) { valVerde = valVerde + 1; delay(300); } if (colore == 1 and valDieci == 1) { valVerde = valVerde + 10; delay(300); } if (colore == 1 and valCento == 1) { valVerde = valVerde + 100; delay(300); } if (colore == 2 and valUno == 1) { valBlu = valBlu + 1; delay(300); } if (colore == 2 and valDieci == 1) { valBlu = valBlu + 10; delay(300); } if (colore == 2 and valCento == 1) { valBlu = valBlu + 100; delay(300); } lcd.setCursor(3, 0); lcd.print(valRosso); lcd.setCursor(10, 0); lcd.print(valVerde); lcd.setCursor(3, 1); lcd.print(valBlu); if (valOK == 1) { analogWrite(rosso, valRosso); analogWrite(verde, valVerde); analogWrite(blu, valBlu); } if (valReset == 1) { digitalWrite(rosso, LOW); digitalWrite(verde, LOW); digitalWrite(blu, LOW); valRosso = 0; valVerde = 0; valBlu = 0; colore = 0; lcd.setCursor(3, 0); lcd.print(" "); lcd.setCursor(10, 0); lcd.print(" "); lcd.setCursor(3, 1); lcd.print(" "); } }
Design Drawing
schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity Mounted
1 220 R7,R8,R9,R,R2,R3,R4,R5,R6 AXIAL-0.3 9 Yes
2 3W RGB LED U1 3W RGB LED 1 Yes
3 button6*6*8 KEY1,KEY2,KEY3,KEY4,KEY5,KEY6 KEY-6.0*6.0-2 6 Yes C59982
4 ARDUINO U2 ARDUINO 1 Yes
5 LCD1602_I2C copy U3 LCD-1602 ONLY I2C HOLE_V2 1 Yes

Unfold

Project Attachments
Empty
Project Members
Related Projects
Change a batch
Loading...
Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn