Add Analog LED strip code

This commit is contained in:
coolneng 2019-11-15 23:53:58 +01:00
parent 129a9e6e6f
commit a57d868ab5
3 changed files with 124 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,82 @@
:100000000C945C000C9479000C9479000C947900A9
:100010000C9479000C9479000C9479000C9479007C
:100020000C9479000C9479000C9479000C9479006C
:100030000C9479000C9479000C9479000C9479005C
:100040000C940B010C9479000C9479000C947900B9
:100050000C9479000C9479000C9479000C9479003C
:100060000C9479000C947900000000080002010053
:100070000003040700000000000000000000000072
:10008000250028002B0000000000240027002A0083
:10009000040404040404040402020202020203032E
:1000A0000303030301020408102040800102040836
:1000B000102001020408102011241FBECFEFD8E049
:1000C000DEBFCDBF11E0A0E0B1E0EAE0F5E002C0A4
:1000D00005900D92A030B107D9F721E0A0E0B1E082
:1000E00001C01D92A930B207E1F70E9455010C949E
:1000F00083020C94000090E0FC01EC55FF4F24912A
:1001000080579F4FFC018491882399F090E0880FDD
:10011000991FFC01EA57FF4FA591B491FC01E458E7
:10012000FF4F859194918FB7F894EC91E22BEC936B
:100130008FBF089590E0FC01E859FF4F2491FC0126
:10014000EC55FF4F3491FC01E057FF4FE491EE2353
:10015000C9F0222339F0233001F1A8F4213019F13C
:10016000223029F1F0E0EE0FFF1FE458FF4FA59178
:10017000B4918FB7F894EC91611126C030953E236D
:100180003C938FBF08952730A9F02830C9F0243060
:1001900049F7809180008F7D03C0809180008F7728
:1001A00080938000DFCF84B58F7784BDDBCF84B5AB
:1001B0008F7DFBCF8091B0008F778093B000D2CF3E
:1001C0008091B0008F7DF9CF3E2BDACF3FB7F89406
:1001D0008091050190910601A0910701B09108015D
:1001E00026B5A89B05C02F3F19F00196A11DB11D92
:1001F0003FBFBA2FA92F982F8827BC01CD01620FCE
:10020000711D811D911D42E0660F771F881F991F88
:100210004A95D1F708951F920F920FB60F921124AD
:100220002F933F938F939F93AF93BF93809101013F
:1002300090910201A0910301B0910401309100015D
:1002400023E0230F2D3758F50196A11DB11D2093F2
:1002500000018093010190930201A0930301B093E8
:1002600004018091050190910601A0910701B091D0
:1002700008010196A11DB11D80930501909306010F
:10028000A0930701B0930801BF91AF919F918F9107
:100290003F912F910F900FBE0F901F90189526E859
:1002A000230F0296A11DB11DD2CF789484B5826030
:1002B00084BD84B5816084BD85B5826085BD85B50A
:1002C000816085BD80916E00816080936E00109288
:1002D0008100809181008260809381008091810003
:1002E0008160809381008091800081608093800094
:1002F0008091B10084608093B1008091B0008160F2
:100300008093B00080917A00846080937A0080911D
:100310007A00826080937A0080917A008160809375
:100320007A0080917A00806880937A001092C100F0
:1003300087E00E947B0086E00E947B0085E00E94AF
:100340007B0084E00E947B0083E00E947B0090E4BD
:10035000392ECC24CA9423E0D22EE12CF12C00E0DB
:1003600010E030927C0080917A00806480937A0063
:1003700080917A0086FDFCCF80917800A091790071
:10038000BA2FA82F25E030E00E947C02A701960139
:100390000E942C02E90160E087E00E949A0060E080
:1003A00086E00E949A0060E085E00E949A0060E08A
:1003B00084E00E949A0060E083E00E949A001C168C
:1003C0001D06FCF461E087E00E949A00C130D1056F
:1003D000C1F061E086E00E949A00C230D10589F048
:1003E00061E085E00E949A00C330D10551F061E0E0
:1003F00084E00E949A00249721F061E083E00E944B
:100400009A000E94E6002B013C0182E3882E912C89
:10041000A12CB12C0E94E600641975098609970980
:10042000683E734081059105A8F321E0821A910886
:10043000A108B10888EE480E83E0581E611C711CAB
:1004400081149104A104B10429F70115110509F4DF
:1004500088CF0E94000085CF052E97FB1EF40094E4
:100460000E94430257FD07D00E944B0207FC03D0B5
:100470004EF40C94430250954095309521953F4F92
:100480004F4F5F4F089590958095709561957F4F80
:100490008F4F9F4F0895A1E21A2EAA1BBB1BFD018F
:1004A0000DC0AA1FBB1FEE1FFF1FA217B307E40753
:1004B000F50720F0A21BB30BE40BF50B661F771FAB
:1004C000881F991F1A9469F760957095809590958B
:1004D0009B01AC01BD01CF010895A29FB001B39F64
:1004E000C001A39F700D811D1124911DB29F700D3D
:1004F000811D1124911D08950E946D02B7FF08957A
:0A050000821B930B0895F894FFCFBF
:00000001FF

View File

@ -0,0 +1,42 @@
// Analog LED Strip
int LED1 = 7;
int LED2 = 6;
int LED3 = 5;
int LED4 = 4;
int LED5 = 3;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
}
void loop() {
int analog = analogRead(A0);
analog = map(analog, 0, 1023, 0, 5);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
if(analog > 0) {
digitalWrite(LED1, HIGH);
}
if (analog > 1){
digitalWrite(LED2, HIGH);
}
if (analog > 2){
digitalWrite(LED3, HIGH);
}
if (analog > 3){
digitalWrite(LED4, HIGH);
}
if (analog > 4){
digitalWrite(LED5, HIGH);
}
delay(50);
}