From 2c748ea18a204c8b7d3f2df219f2a65e2c3d8273 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 15 Nov 2019 23:55:30 +0100 Subject: [PATCH] Add Ultrasonic (HC-SR04) code --- Ultrasonic/Ultrasonic.arduino.avr.uno.elf | Bin 0 -> 34496 bytes Ultrasonic/Ultrasonic.arduino.avr.uno.hex | 187 ++++++++++++++++++++++ Ultrasonic/Ultrasonic.ino | 47 ++++++ 3 files changed, 234 insertions(+) create mode 100755 Ultrasonic/Ultrasonic.arduino.avr.uno.elf create mode 100644 Ultrasonic/Ultrasonic.arduino.avr.uno.hex create mode 100644 Ultrasonic/Ultrasonic.ino diff --git a/Ultrasonic/Ultrasonic.arduino.avr.uno.elf b/Ultrasonic/Ultrasonic.arduino.avr.uno.elf new file mode 100755 index 0000000000000000000000000000000000000000..ffbba9e86120c434c8a34589c14df9a39908f639 GIT binary patch literal 34496 zcmdsg34B%6wfEll+?$ys49X0Fgh?_J0wNFs34;QO%u?}^;X)#r%z)A=B!CLakjqU( zt2Sz_)(*}?tpjNL`fOhnJ3MQLuU>uD*ZQmmrD9u^@BiQX?0e5W!M5*veZQZ-@4!B1 zt^Znk?X}n5XP?9GyWe;yERT;p^1!@@<6l3W9)A9< zm&4xU6OMi=Q+w|8Jy-mb_#d85?RnBl>3Q6jf`C78z4lkIJM_(F(JHvdg7^!@b0{X-p+70xM}^VJs*m$ z!K^uL-+l1wX-}f;uWme6ksaI%+wvyb*n9Y%{ZH)A4&AZ;q5TJfds;ec4}?Mo_a3}? zXxwqnz7O_?b2_^YU(>lKq1PF=cVt(1-{D&i9)RAcK=LG)8-!d-{%b!6#?z5_&((O+J_&PVQTeUf)_?0;-LQ_;Vhr6eDId;eciYG?I{6Ku(MsX1gi#5 zKAzt@KXY#A@Uev6Df##HPtE^fe^&mo)1ARiarhee!sC^lp-%DIiM@{NL#(yk-e~I?t zV@YrRCHQmrk*ZqZK=6&caPOha1EHy1Z)E-+ZJ_I_y?tZ)JMimN)A z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#c-rS5X5dJ|jq&EhtI?SaT&1rK`ljep}Td!34Emd{u#l8ePJZS7dK){1x~(m@S>)C>M|u5*-G!-jBY53jza24Yt1m((zk~G$xWXhV_G|rE^$6#03T!Qe zeiR5?#rNdgE5lff(t=eU&0AZm8lh*u)GuV7j>e7#ypgX*JPcldHA+}`QpxZ2m9Aa^ zL0RdVQa?_-Wfd#^%ga|TS))%%EN^IRX~wFDK$~4jKNcQb#RWp9h@vQ6z~ZW_YOx{( zs}ou~TBuiB)n0|l0Sz=^C7Q{Hl}lI(5Vam7bhuhbI%-2Nl>vgqH*K~>w1`cirX8lL z%PSULbe0+!w`WFODJTG~*Buz|*wZ5PEC+pllqT%#1z`2+O6|EG&QOIDVyS-YzIEcIyTs=CWN8e0n0_{f!7ktR}ZHMi_g<-iUD zqyxvF?ncXC)1hOv)wA8OdaNbZCr4eWuy%F%s=w)y2`$5E(*>-CZY$Gr+EZQmNOy)7 z3my2Jw9`pjWQ-aA3LA&`N^6Ez|4l*E48h}-q&voW-}yRR(-%0 s)WG3KjS`MVk4J~wqO%<~;UDkMIS;~mkWNH$+Uv$7!Ou+Rfy~(Zzejz<-~a#s literal 0 HcmV?d00001 diff --git a/Ultrasonic/Ultrasonic.arduino.avr.uno.hex b/Ultrasonic/Ultrasonic.arduino.avr.uno.hex new file mode 100644 index 0000000..3964a76 --- /dev/null +++ b/Ultrasonic/Ultrasonic.arduino.avr.uno.hex @@ -0,0 +1,187 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C948A000C948A000C948A0028 +:100030000C948A000C948A000C948A000C948A0018 +:100040000C94DE020C948A000C94AC020C94860290 +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000008D6 +:10008000000201000003040700000000000000005F +:1000900000000000230026002900040404040404D6 +:1000A0000404020202020202030303030303010227 +:1000B00004081020408001020408102001020408F6 +:1000C00010206D0311241FBECFEFD8E0DEBFCDBFDF +:1000D00011E0A0E0B1E0E0E7FBE002C005900D9286 +:1000E000A432B107D9F721E0A4E2B1E001C01D922A +:1000F000AF3DB207E1F710E0C2E6D0E004C02197BF +:10010000FE010E94A105C136D107C9F70E94B903BB +:100110000C94B6050C940000AF92BF92CF92DF9280 +:10012000EF92FF920F931F93CF93DF936C017B01AC +:100130008B01040F151FEB015E01AE18BF08C0173D +:10014000D10759F06991D601ED91FC910190F081B0 +:10015000E02DC6010995892B79F7C501DF91CF9173 +:100160001F910F91FF90EF90DF90CF90BF90AF90D5 +:100170000895FC01538D448D252F30E0842F90E0AD +:10018000821B930B541710F0CF9608950197089592 +:10019000FC01918D828D981761F0A28DAE0FBF2F5B +:1001A000B11D5D968C91928D9F5F9F73928F90E0B1 +:1001B00008958FEF9FEF0895FC01918D828D981720 +:1001C00031F0828DE80FF11D858D90E008958FEF5D +:1001D0009FEF0895FC01918D228D892F90E0805C26 +:1001E0009F4F821B91098F739927089581E391E0B6 +:1001F0000E94EA0021E0892B09F420E0822F089573 +:1002000080E090E0892B29F00E94F60081110C9487 +:1002100000000895FC01A48DA80FB92FB11DA35AA9 +:10022000BF4F2C91848D90E001968F739927848F16 +:10023000A689B7892C93A089B1898C918370806439 +:100240008C93938D848D981306C00288F389E02DDA +:1002500080818F7D80830895EF92FF920F931F938B +:10026000CF93DF93EC0181E0888F9B8D8C8D981369 +:100270001AC0E889F989808185FF15C09FB7F89475 +:10028000EE89FF896083E889F989808183708064C1 +:1002900080839FBF81E090E0DF91CF911F910F910C +:1002A000FF90EF900895F62E0B8D10E00F5F1F4F1B +:1002B0000F731127E02E8C8D8E110CC00FB607FC2A +:1002C000FACFE889F989808185FFF5CFCE010E94B8 +:1002D0000A01F1CFEB8DEC0FFD2FF11DE35AFF4F1B +:1002E000F0829FB7F8940B8FEA89FB898081806246 +:1002F000CFCFCF93DF93EC01888D8823B9F0AA8903 +:10030000BB89E889F9898C9185FD03C0808186FDD0 +:100310000DC00FB607FCF7CF8C9185FFF2CF80811F +:1003200085FFEDCFCE010E940A01E9CFDF91CF9189 +:10033000089590E0FC01E458FF4F2491FC01E25540 +:10034000FF4F3491FC01E656FF4FE491EE23C9F0D4 +:10035000222339F0233001F1A8F4213019F12230A1 +:1003600029F1F0E0EE0FFF1FEE58FF4FA591B49179 +:100370008FB7F894EC91611126C030953E233C93E1 +:100380008FBF08952730A9F02830C9F0243049F7ED +:10039000809180008F7D03C0809180008F77809353 +:1003A0008000DFCF84B58F7784BDDBCF84B58F7DB0 +:1003B000FBCF8091B0008F778093B000D2CF809137 +:1003C000B0008F7DF9CF3E2BDACFCF93DF9390E053 +:1003D000FC01E255FF4F249186569F4FFC0184910A +:1003E0008823D1F090E0880F991FFC01E859FF4F56 +:1003F000A591B491FC01EE58FF4FC591D4916111C4 +:100400000EC09FB7F8948C91E22FE0958E238C93C9 +:100410002881E223E8839FBFDF91CF9108958FB7B2 +:10042000F894EC91E22BEC938FBFF6CF3FB7F894A2 +:100430008091290190912A01A0912B01B0912C016A +:1004400026B5A89B05C02F3F19F00196A11DB11D2F +:100450003FBFBA2FA92F982F8827BC01CD01620F6B +:10046000711D811D911D42E0660F771F881F991F26 +:100470004A95D1F708958F929F92AF92BF92CF92F3 +:10048000DF92EF92FF924B015C010E9416026B011A +:100490007C010E9416026C197D098E099F09683E35 +:1004A000734081059105A8F321E0821A9108A10803 +:1004B000B10888EEC80E83E0D81EE11CF11C81143F +:1004C0009104A104B10429F7FF90EF90DF90CF9041 +:1004D000BF90AF909F908F90089560E083E00E945E +:1004E000990160E084E00E94990160E085E00C944D +:1004F0009901FC0101900020E9F73197AF01481BF9 +:10050000590BBC0181E391E00C948C001F920F9277 +:100510000FB60F9211242F933F934F935F936F93D6 +:100520007F938F939F93AF93BF93EF93FF9381E359 +:1005300091E00E940A01FF91EF91BF91AF919F91CD +:100540008F917F916F915F914F913F912F910F907C +:100550000FBE0F901F9018951F920F920FB60F921B +:1005600011242F938F939F93EF93FF93E091410179 +:10057000F09142018081E0914701F091480182FDB4 +:100580001BC0908180914A018F5F8F7320914B0136 +:10059000821741F0E0914A01F0E0EF5CFE4F958F49 +:1005A00080934A01FF91EF919F918F912F910F902E +:1005B0000FBE0F901F9018958081F4CF1F920F925D +:1005C0000FB60F9211242F933F938F939F93AF9366 +:1005D000BF938091250190912601A0912701B091B0 +:1005E00028013091240123E0230F2D3758F501967F +:1005F000A11DB11D20932401809325019093260114 +:10060000A0932701B09328018091290190912A019C +:10061000A0912B01B0912C010196A11DB11D8093D9 +:10062000290190932A01A0932B01B0932C01BF9133 +:10063000AF919F918F913F912F910F900FBE0F908F +:100640001F90189526E8230F0296A11DB11DD2CF49 +:10065000CF92DF92EF92FF920F931F93E82FF92F23 +:1006600005C0015011092109310961F190819623DA +:100670009417B9F305C0015011092109310911F18D +:10068000908196239413F7CFC12CD12CE12CF12C1F +:100690000AC08FEFC81AD80AE80AF80A0C151D0517 +:1006A0002E053F0579F080818623841791F36C2D08 +:1006B0007D2D8E2D9F2D1F910F91FF90EF90DF903C +:1006C000CF90089560E070E080E090E01F910F917E +:1006D000FF90EF90DF90CF900895CF93DF93E1E309 +:1006E000F1E01382128288EE93E0A0E0B0E0848310 +:1006F0009583A683B78384E091E09183808385EC22 +:1007000090E09587848784EC90E09787868780ECDB +:1007100090E0918B808B81EC90E0938B828B82ECCC +:1007200090E0958B848B86EC90E0978B868B118E76 +:10073000128E138E148ECEECD1E089E090E09D8372 +:100740008C8388E090E09F838E8360E089E00E9444 +:10075000E50161E08E810E94E501188A87EE93E051 +:10076000A0E0B0E08C879D87AE87BF87DF91CF91F7 +:100770000895CF93DF93CDB7DEB7A1970FB6F89466 +:10078000DEBF0FBECDBF789484B5826084BD84B5D2 +:10079000816084BD85B5826085BD85B5816085BD7C +:1007A00080916E00816080936E0010928100809134 +:1007B00081008260809381008091810081608093BC +:1007C0008100809180008160809380008091B100E1 +:1007D00084608093B1008091B00081608093B0000C +:1007E00080917A00846080937A0080917A008260A0 +:1007F00080937A0080917A00816080937A00809162 +:100800007A00806880937A001092C100E0914101E3 +:10081000F091420182E08083E0913D01F0913E0140 +:100820001082E0913F01F09140018FEC80831092A3 +:100830004901E0914501F091460186E08083E09115 +:100840004301F0914401808180618083E091430104 +:10085000F0914401808188608083E0914301F091B0 +:100860004401808180688083E0914301F0914401DC +:1008700080818F7D808361E083E00E94E50161E0FB +:1008800084E00E94E50161E085E00E94E50160E00E +:1008900089E00E94E50161E088E00E94E50193E0C3 +:1008A000A92EB12C23E2222E312C3AE0432E512CDA +:1008B000612C712C40E0842E40E0942E1092D601E1 +:1008C0001092D7011092D8011092D90160E0809166 +:1008D000D4010E949901C5010197F1F761E080916F +:1008E000D4010E949901C1010197F1F760E0809164 +:1008F000D4010E949901C5010197F1F78091D201BD +:100900009091D3019927FC01E255FF4F6491FC01BE +:10091000E656FF4FE491F0E0EE0FFF1FE057FF4F68 +:100920008591949100EF19E422E030E0462F0E9477 +:1009300028036B017C01C114D104E104F10439F0F6 +:100940008FEFC81AD80AE80AF80A9FE0F922C09285 +:10095000D601D092D701E092D801F092D90169E195 +:1009600070E080E090E00E943B02A4E6B0E0A701C6 +:1009700096010E9496052AEF36E140E050E00E9481 +:10098000770520932D0130932E0140932F01509332 +:10099000300182E191E00E9479028EE191E00E94B3 +:1009A0007902C0902D01D0902E01E0902F01F0909F +:1009B0003001F7FE56C06DE281E391E00E942C0108 +:1009C00022273327A9012C193D094E095F0919A2D5 +:1009D000FE01B1967F01CA01B901A30192010E94F3 +:1009E0005505605DF70162937F01211531054105D1 +:1009F000510589F7E114F10419F0C7010E94790249 +:100A00008EE191E00E94790281E291E00E947902F8 +:100A10008EE191E00E94790280912D0190912E014A +:100A2000A0912F01B091300188309105A105B10549 +:100A300074F50E946D0260E083E00E94990164E613 +:100A400070E080E090E00E943B028114910409F480 +:100A500035CF0E94F600882309F430CF0E940000B1 +:100A60002DCFA701960119A2CE0181967C01CA0162 +:100A7000B901A30192010E945505605DF7016293DF +:100A80007F01211531054105510589F7B3CF0F9736 +:100A9000A105B1052CF40E946D0260E084E0CDCF89 +:100AA0000E946D0260E085E0C8CFA1E21A2EAA1B69 +:100AB000BB1BFD010DC0AA1FBB1FEE1FFF1FA2170E +:100AC000B307E407F50720F0A21BB30BE40BF50B0B +:100AD000661F771F881F991F1A9469F76095709594 +:100AE000809590959B01AC01BD01CF010895052E25 +:100AF00097FB1EF400940E948E0557FD07D00E94BC +:100B0000550507FC03D04EF40C948E055095409586 +:100B1000309521953F4F4F4F5F4F089590958095A9 +:100B2000709561957F4F8F4F9F4F08950E94A70545 +:100B3000A59F900DB49F900DA49F800D911D112431 +:100B40000895EE0FFF1F0590F491E02D0994A29FE8 +:100B5000B001B39FC001A39F700D811D1124911D91 +:100B6000B29F700D811D1124911D0895F894FFCF3F +:100B7000000000002C018C00B9007901EA00C800D7 +:100B8000DC0044697374616E6369613A20000D0A88 +:040B900000636D0091 +:00000001FF diff --git a/Ultrasonic/Ultrasonic.ino b/Ultrasonic/Ultrasonic.ino new file mode 100644 index 0000000..1b1d34d --- /dev/null +++ b/Ultrasonic/Ultrasonic.ino @@ -0,0 +1,47 @@ +// Ultrasonic sensor +#include + +#define red 3 +#define yellow 4 +#define green 5 +#define echo 9 +#define trig 8 +SR04 sr04 = SR04(echo, trig); +long length; + +void turnOff() { + digitalWrite(red, LOW); + digitalWrite(yellow, LOW); + digitalWrite(green, LOW); +} + +void turnOn(int LED) { + turnOff(); + digitalWrite(LED, LOW); +} + +void setup(){ + Serial.begin(9600); + pinMode(red, OUTPUT); + pinMode(yellow, OUTPUT); + pinMode(green, OUTPUT); + pinMode(echo, INPUT); + pinMode(trig, OUTPUT); +} + +void loop() { + length = sr04.Distance(); + Serial.println("Distancia: "); + Serial.println(length); + Serial.println("cm"); + + if(length < 8){ + turnOn(red); + } else if (length < 15){ + turnOn(yellow); + } else { + turnOn(green); + } + + delay(100); +}