Im currently trying to make a gift for my gf, my 8x8 led display workds perfect, its the ir sensor I tried implementing to turn it off/off or to dim/brighten it that wont work. Is thisdue to my code or faulty hardware? Thanks in advance!
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <IRremote.h>
const int RECV_PIN = 7;
IRrecv IrReceiver(RECV_PIN);
decode_results results;
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4 // 4 blocks
#define CS_PIN 3
int Bright = 7;
int ON = 1;
MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
Serial.begin(9600);
IrReceiver.enableIRIn();
IrReceiver.blink13(true);
Serial.println(RECV_PIN);
ledMatrix.begin();
ledMatrix.setIntensity(Bright);
ledMatrix.displayClear();
IrReceiver.enableIRIn();
ledMatrix.displayScroll("Sweet heartfell message", PA_CENTER, PA_SCROLL_LEFT, 80);
}
void loop() {
if (ledMatrix.displayAnimate()) {
ledMatrix.displayReset();
}
if (IrReceiver.decode(&results) == 0xFFA25D) { //off
Bright =0;
ON == 2;
IrReceiver.resume();
}
if(IrReceiver.decode(&results) == 0xFFA25D && ON == 2){
Bright =7;
ON == 1;
IrReceiver.resume();
}
if (IrReceiver.decode(&results) == 0xF076C13B) { //down
Bright =-1;
IrReceiver.resume();
}
if (IrReceiver.decode(&results) == 0xFF906F) { //up
Bright =+1;
IrReceiver.resume();
}
}
DaveX
August 7, 2024, 2:36am
2
Test your hardware with an example program for your hardware. If it works there, then it is your code.
/*
* ReceiveDump.cpp
*
* Dumps the received signal in different flavors.
* Since the printing takes so much time (200 ms @115200 for NEC protocol, 70ms for NEC repeat),
* repeat signals may be skipped or interpreted as UNKNOWN.
*
* This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
*
************************************************************************************
* MIT License
*
* Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
This file has been truncated. show original
I think its hardware issues, sucks I guess.
��Ð����X`�ؘq0�iY�e��X�ZHZ�Y�J�i�=Y%�-�i��@��I�iAI�іa��H��єD��~�Q�Il���Q�Yhy�Z�ɠ�yL�(�Z0���@Q�Q�Q��Aj� ���z*$�X
����5�~�(�H�HHHHHHHHHHJJJJJJJJhؖ����@������tA=y�iiY��Y��KY��qk����ZֶAiz���Qa�H�Ii�jj�Q%�-�ij2�ܘ��0�A�<�Q�Z=A�YqXjY��$X��ֺ�c�qH�Q�Q�Q��h�Q���h�
��H,Ԁ�������������,A�HIEa�aHA(�hؖa�<@|����tA9�y�IiY�eY��[�Z�qk������eԔIi���іa��H����a�H������8z[�Q�Yjy�ZA�<�Q��O!���>�J�@��@A�A�A���H �h�aY��i�L(���H�<slX%JJB�����I�,�<�����<ɶX�YZ�X���������Ay
a��$VѴ�a�H�-�ij�h�A!�4�j�h���a�L���Z��K1A�xY�Xz=A�hq�Z�
�ZP)���
����Q�%I�h��H���KIPI���!��ap��?�NQ��Q�Q�Q��QQQQ����Ԟ����@�d����IY��[�ZH��ѐJ�X�Y���-��XI-����*�I��iYh�Qa�4�҃A������q�5�yq�Z5A�xqXA�-���Ӟ>K[���h���K�Y�JA5�aQ�ݍ��ؐz��<h<�����J�B��QQQQQ�x�i�H���e�'��[�Z�Y�J�X�YZX��XФ�٣���a���Q��і!�J�z��Ѵ�a�H�X���p��yIa���+���[5A�hq�X5A�xq�Z^8�a���8[JJ�JHJHJA�Ԕ�jQAː-�M�K��y��)%�]�HHJJJJ�J�JJJJJJJ�Q���`˃('��xq�ؘ�0�ii�J�Y��KY��XH
���=Q���J��I-�iY��H�I�i���і%aJ�z6����>K��I��Q�X5A�QY�Yl�X�-�:P�r��jh �AѴ`��A5I�Ѵha���
�X����y�[�����⼲Ø������`�ؘqp�����I5ky�ai�H���ӫ�X`���A%�
���h�(��Ii��҃A���F似Z�KqXY�Izy<�yQ�Z�����~��$JY�hh��`aj�JI���!��a����� JJJJJJJ�J�JJJ�������a���0�hI㏲=��a�=P�HY��[�ZH[�ѐJ�X�O����A��҃A����I-i�����I�iAIh��T��
��jzY�K=A�xq�Xj5I�Qټ�0����<�%n�J�A�A�A�@��IaI�H���`˃*�������-����������LaA�A�A�������8@�d������Y�[�ѐJ�X�Y^�Z�X�a���C��p����Aa��X������A%���j�h�yI��+���KqA�zY�Yz=�hy�Z�ڸi�H�Ӛ>K[���HJHP�QaJH�aA7�=�� K���˘x��QaQ�Q��Q�QQQ��Q���-�M�<@�6�����Y����Z�ِJ�X�Y^��X�a��� Ih�і%a��zц�Q�!�J�z����Qa�5%�����I�jy�Z�I���y�Z=I�x��a����:�� JI�h��AJA��Ha��p,G�(�k�Ӡ�=�NaQaQQ�Q��QaQ�Q�Q������q����e�'���J��ѰɐZ�X�YЭ�������Y�IP�AeQa�0�h�h���a��e�h��0=���q�j=A��Y�Yz=�Y�Ylڸi�H���)J[JAJ���Q��p��@�Aڸi�H,Ke+������������������Д�L�hx}�aҒ������t��a�yy�Ii��eY���p�������ԴIi��j�@$a����h�Ѷ%a��j��b��>K��Y�KqA�zY�Xz=A��Y�Xc�=Ga��`J���A�j� �HaYpH��i.=�e�i�-�%%��A�A
A�A�A�aa�AJAaJJh�a��HڔiV�Y��Aa�Y��Y^�Z�X��������P��RVI-�j��$�H������AH���i�h�yIe�PG���xq�Xz=A��Y�Xz=I�Q��&!�����Pa��@A�A�A��hHіIYPڸ&!��a���I11113%J�h�&!�Ҙ �/� O��J�ZH[�ѐJ�X�Y�YZ����C�Qa����j�@$a��Jц�і%a��AIh��T��
��JhY�Z=I�xqXjY�Yj�NԎ�����
�=��@��H%I�h�PaHph������K��y���)�A�A�A�A�A�A�aAaQaQQ�i.�Xc�I�������x�A����Н�i�A9cy�iZ%��P@�h��0H�h�h���a�0e�h�h.@��F�似Z��K5A�xyXzQ�Yjy��
�X��ֺ�cֶhIlKj��Q�QA��Aj�A����
�Z����y�[������������8b�d��I�
y�Y�eY��[�J��X�.���0*��I-�i��h�Q%�-�ijh�eQa��j2�ܜ��0�jY�[5A�xyXzQ�Yzy��y-i��˘<t���A�A����AQA���H���`�(��˩����X%JJJJJJJJ��������r����dP��Z�[�ZH[�ѐA�ZX�]���Z����Ѷ%a��JY��і%a��Ih��T��
��JjQ�[5A�xyXzQ�Yj�NЎ�����
�=��@���K�IPajHPh������K�����x)��AAAJ�A�QaaaQQ�h�a�Һ����8�Y^�Z�X���������I=�c�����і!a�J����Qa��I-j��H�Hv����>K��I��Q�Xz=A�QQ�Xz5A�<}��A�=PGq�.���@���h��A�H��AQ
��<}�z��-N���`�QaQaQ�Q�Q�Q�QaQQ�Q�����]d:>Ԣi`X�Y^�Z�X������������
AJQ��іa�J�I-Q�a��I-�Aj��5%�����H<Y�Z=I�xy�XQ�YJ��G����:��(�JI�h��AJA��IaYpB�.G�h�k�Ӡ�=�NaQaQaQ�Q��QQ�Q�Q�����0���Q��=Ҫap��%aYI�Y�e�X�ZH�������HԔI-�iY@�֔Ii��j���HִIi�È��8�Y�K5A�y�XY�IzyX���X�����QAn�j�HPHPHa-��YPQ-��i���X
ܸ��=��b����A�A�A�A�A
A
A�A��h<-�zaZЀ�ؼ��,h�ZX�Y^������ЖaI=�c����Q�hj����I�-ij���H�I�i��j�Q�e�]Z�!����I�j1�iq�ZkY�KqA����!D��
��Z��@��JHPH%j�@���AQ��4��6��{�[�@`L
�A�AA
�A
HH��-��<@�d�+)RVI�ei��
eY��[�Z�ِJ
���Aa�4�j�h�Qa�0�h�h���a��hr��ؾ>�
Q�Xe=I��Y�Yz=A��Q��y-i��K����@A�@Q�Q�і�IQn� a�z�$�¡������-�Q�����������������i.�Xa�I�������y�I����Н�i�A9q�aZ%��P��h$�0�h�h.��0e�h�h����L,�aɼZ��K5A�xyXjQ�Yl���
�X��ֺ�cֶ�I�IYpH��QA��A*�A����
�X����y�[��������x�i�H����$�A��JY���ɐZ���Xҭ���L�
�Р���h�eQa��j�h$�0H�h�h���I��qX�e5I��Y�Xz=I��Q�Yzڸ������|yh �JA-���ѴhI�� �h�!����H�,Kei���QQQQQQQ�Q�������
�ZҸ<>Բ⎌��@P[�ѐJ�Z�X�YZX��Н�aPN��RVXH�����*��I��ij�h�(��I-�i�h�yIa���+���Z5A�hy�XzY�Yz=A�QJ�&Xi�>�
�h��@A�A�A��hI�0AI�Pڸ���H���0�ښ� JJJJJJJJJJJJJJJJJJJJJ�h<m�at�:�ظ���h�Z�X�Xҭ�����I5y�����@�hj���H�-ij��HԔI)�ij�@�eօ�!���M�hqXjY�Iz=�Y�Y�
�ZҸǫ�
��j��@��JHPHPQ��Ijh�������{�[�@$Ea
a�AAA�A
�A��hB�,E�h���/� O�PPZX�X�YZ�X��Е�i�Iyc��$�A�%ِXA��AI�і%a��z���Qa�Z%�����H�jy�Z�I�<ry�ZI�<��6���:��$JAI�h��H@��I�j�PI��E�,�{�[�`�HHHHHHHHHHHJJJJJJJJJJ������Ԣi�EX����eIy�q�Ai��e��ӫ�P$��a��I)j�AH�-�ijh�Q%�-����
��hy�ZkY�KqA�xY�X�-�:P�r���@��@���h��Ajj��A�j�<-�:�-����`�Q�QQ�Q�Q�QQQ���x�i�H����$�AJ�Y�J�X�Y^�Z�X������p��
�@�h���a�0H��h.��J��I-�i��Z0-
�aɼZ��KqA�hY�Xz=I�QY�X�
�ZҸ�c��Z��`��HHPHPQ��KY�@A����
�ZҸ�y�[�����
DaveX
August 7, 2024, 3:49am
4
Is the serial monitor set to the matching baud rate?
123sethdbr:
faulty hardware
What IR sensor are you using? I use TSOP38238 successfully with the IRRemote library.
What version of the library are you using? I'm using 4.4.0 and it seems the library isn't
123sethdbr:
#include <IRremote.h>
anymore, but
#include <IRremote.hpp>
and other changes from the older versions of the library.
So you could make sure your code is supported by rolling back your library (if it's the case that you're using the new one), or make all the necessary changes found here:
Infrared remote library for Arduino: send and receive infrared signals with multiple protocols