To Tom Meyers,
Thank you for your advice.
I do appreciate it.
I ordered 74HC148 yesterday and I will receive it tomorrow.
So, I'll try to verify that 74HC148 with ESP32 works correctly.
Maybe, as is the case with 74HC138, 74HC148 used with ESP32 doesn't work correctly.
To all,
I used universal board because breadboard might cause that defect.
And I used my code(Version 1), but the result was the same.
When I pressed #0 switch, I got 4. ←wrong
When I pressed #1 switch, I got 1. ←right
When I pressed #2 switch, I got 2. ←right
When I pressed #3 switch, I got 1 or 3. ←wrong
When I pressed #4 switch, I got 6. ←wrong
When I pressed #5 switch, I got 5. ←right
When I pressed #6 switch, I got 0. ←wrong
When I pressed #7 switch, I got 7. ←right
- IMG_20181011_094426.jpg (2.38 MiB) Viewed 7003 times
This defect happens under any circumstances.
On the other hand, if I change the wirings appropriately, it is no longer a problem except #3 switch.
I noticed another interesting thing.
I tried ESP32-DevKitC(made by Espressif Systems) in the same circuit and same code(version 1).
- IMG_20181011_220340.jpg (2.68 MiB) Viewed 7003 times
The result is following.
When I pressed #0 switch, I got 4. ←wrong
When I pressed #1 switch, I got 1. ←right
When I pressed #2 switch, I got 2. ←right
When I pressed #3 switch, I got 3. ←right
When I pressed #4 switch, I got 0. ←wrong
When I pressed #5 switch, I got 5. ←right
When I pressed #6 switch, I got 6. ←right
When I pressed #7 switch, I got 7. ←right
#0 switch and #4 switch have replaced each other.
This defect depends on developer kit!
Here is a comparison of developer kit.
ESPr® Developer 32(made by SWITCH SCIENCE)................ESP32-DevKitC(made by Espressif Systems)
When I pressed #0 switch, I got 4. ←wrong.............
When I pressed #0 switch, I got 4. ←wrong
When I pressed #1 switch, I got 1. ←right.......................When I pressed #1 switch, I got 1. ←right
When I pressed #2 switch, I got 2. ←right.......................When I pressed #2 switch, I got 2. ←right
When I pressed #3 switch, I got 1 or 3. ←wrong.......When I pressed #3 switch, I got 3. ←right
When I pressed #4 switch, I got 6. ←wrong.............
When I pressed #4 switch, I got 0. ←wrong
When I pressed #5 switch, I got 5. ←right.......................When I pressed #5 switch, I got 5. ←right
When I pressed #6 switch, I got 0. ←wrong.............When I pressed #6 switch, I got 6. ←right
When I pressed #7 switch, I got 7. ←right.......................When I pressed #7 switch, I got 7. ←right
I changed the wirings appropriately(#0 switch → PIN 4 of HC138 and #4 switch → PIN 0 of HC138).
When I pressed #0 switch, I got 0. ←right
When I pressed #1 switch, I got 1. ←right
When I pressed #2 switch, I got 2. ←right
When I pressed #3 switch, I got 3. ←right
When I pressed #4 switch, I got 4. ←right
When I pressed #5 switch, I got 5. ←right
When I pressed #6 switch, I got 6. ←right
When I pressed #7 switch, I got 7. ←right
All right! Yeah