Add RGB with potentiometers code

This commit is contained in:
coolneng 2019-11-15 23:54:41 +01:00
parent 85da32886c
commit 66bc1ba18f
3 changed files with 107 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,85 @@
:100000000C945C000C9479000C9479000C947900A9
:100010000C9479000C9479000C9479000C9479007C
:100020000C9479000C9479000C9479000C9479006C
:100030000C9479000C9479000C9479000C9479005C
:100040000C9454010C9479000C9479000C94790070
:100050000C9479000C9479000C9479000C9479003C
:100060000C9479000C947900000000080002010053
:100070000003040700000000000000000000000072
:10008000250028002B0000000000240027002A0083
:10009000040404040404040402020202020203032E
:1000A0000303030301020408102040800102040836
:1000B000102001020408102011241FBECFEFD8E049
:1000C000DEBFCDBF11E0A0E0B1E0E8E3F5E002C0A3
:1000D00005900D92A030B107D9F721E0A0E0B1E082
:1000E00001C01D92AF30B207E1F70E949E010C944F
:1000F0009A020C94000090E0FC01EC55FF4F249113
:1001000080579F4FFC018491882399F090E0880FDD
:10011000991FFC01EA57FF4FA591B491FC01E458E7
:10012000FF4F859194918FB7F894EC91E22BEC936B
:100130008FBF089590E0FC01E859FF4F2491FC0126
:10014000EC55FF4F3491FC01E057FF4FE491EE2353
:10015000C9F0222339F0233001F1A8F4213019F13C
:10016000223029F1F0E0EE0FFF1FE458FF4FA59178
:10017000B4918FB7F894EC91611126C030953E236D
:100180003C938FBF08952730A9F02830C9F0243060
:1001900049F7809180008F7D03C0809180008F7728
:1001A00080938000DFCF84B58F7784BDDBCF84B5AB
:1001B0008F7DFBCF8091B0008F778093B000D2CF3E
:1001C0008091B0008F7DF9CF3E2BDACF1F93CF9374
:1001D000DF93182FEB010E947B00209739F460E039
:1001E000812FDF91CF911F910C949A00CF3FD105C1
:1001F00011F461E0F5CFE12FF0E0E859FF4FE49111
:10020000E33031F140F4E130B1F0E230E1F0C038F8
:10021000D1057CF7E4CFE73029F1E83059F1E4303B
:10022000B1F780918000806280938000D0938B0032
:10023000C0938A0004C084B5806884BDC7BDDF91C7
:10024000CF911F91089584B5806284BDC8BDF7CF5A
:1002500080918000806880938000D0938900C09353
:100260008800EDCF8091B00080688093B000C0938B
:10027000B300E5CF8091B00080628093B000C0935E
:10028000B400DDCF8E50806480937C0080917A0032
:10029000806480937A0080917A0086FDFCCF809103
:1002A00078009091790008951F920F920FB60F92E7
:1002B00011242F933F938F939F93AF93BF9380917C
:1002C0000B0190910C01A0910D01B0910E013091A4
:1002D0000A0123E0230F2D3758F50196A11DB11D0A
:1002E00020930A0180930B0190930C01A0930D01C0
:1002F000B0930E018091060190910701A091080131
:10030000B09109010196A11DB11D80930601909342
:100310000701A0930801B0930901BF91AF919F918C
:100320008F913F912F910F900FBE0F901F901895B6
:1003300026E8230F0296A11DB11DD2CFCF93DF93E4
:1003400000D000D0CDB7DEB7789484B5826084BD8C
:1003500084B5816084BD85B5826085BD85B58160C9
:1003600085BD80916E00816080936E001092810047
:100370008091810082608093810080918100816002
:1003800080938100809180008160809380008091C3
:10039000B10084608093B1008091B000816080934F
:1003A000B00080917A00846080937A0080917A0016
:1003B000826080937A0080917A00816080937A00D5
:1003C00080917A00806880937A001092C10083E067
:1003D0000E947B0085E00E947B0086E00E947B00FB
:1003E000CC24CA9483E0D82EE12CF12C8EE00E941C
:1003F00042012FEF30E0DC010E949302A701960139
:100400000E944302290130930501209304018FE0EB
:100410000E9442012FEF30E0DC010E949302A7010D
:1004200096010E9443024901309303012093020187
:1004300080E10E9442012FEF30E0DC010E94930234
:10044000A70196010E94430229833A834B835C8370
:1004500089819A819093010180930001B20183E028
:100460000E94E600B40186E00E94E60069817A817C
:1004700085E00E94E60080E090E0892B09F4B6CF89
:100480000E940000B3CF052E97FB1EF400940E943B
:100490005A0257FD07D00E94620207FC03D04EF4B7
:1004A0000C945A0250954095309521953F4F4F4FEF
:1004B0005F4F089590958095709561957F4F8F4F10
:1004C0009F4F0895A1E21A2EAA1BBB1BFD010DC070
:1004D000AA1FBB1FEE1FFF1FA217B307E407F507F4
:1004E00020F0A21BB30BE40BF50B661F771F881FD0
:1004F000991F1A9469F760957095809590959B0166
:10050000AC01BD01CF010895A29FB001B39FC0010E
:10051000A39F700D811D1124911DB29F700D811D2F
:100520001124911D08950E948402B7FF0895821B33
:08053000930B0895F894FFCF2E
:00000001FF

View File

@ -0,0 +1,22 @@
// RGB with potentiometers
int red = 3;
int blue = 5;
int green = 6;
int redValue = 0;
int blueValue = 0;
int greenValue = 0;
void setup() {
pinMode(red, OUTPUT);
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
redValue = map(analogRead(A0), 0, 1023, 0, 255);
greenValue = map(analogRead(A1), 0, 1023, 0, 255);
blueValue = map(analogRead(A2), 0, 1023, 0, 255);
analogWrite(red, redValue);
analogWrite(green, greenValue);
analogWrite(blue, blueValue);
}