Open hlide opened 3 months ago
Hi, what about self calibration during first run and/or after holding key 1 (as this key is alway 0) during swith on?
Regarding KEYPAD, a simple self calibration cannot be done. You need to initiate it (how?) then you need to display each button to hold to calibrate it (how?) and so on. Then you would need to sort both voltage level (BVx) and button association (ICx) so the voltage level goes from 0 to 1023.
EDIT: since it is the LCD_KEYPAD_SHIELD, there is a strong feeling that the original design and the clones always share the same order of buttons and having only their voltages varying so we can have only to sort the voltage levels here.
EDIT 2: DONE: Only kept "enabled" and "BVx" in the configuration file with the button in this order : RIGHT, UP, DOWN, LEFT, SELECT. Auto-calibration needs more brainstorming so not a priority here.
I may consider SELECT (enter dir or play file), LEFT (leave dir) and RIGHT (toggle ultra-fast mode) being not auto-repetitive while I kept UP and DOWN auto-repetitive to avoid unwanted actions.
EDIT: DONE for KEYPAD. It is better this way.
You are right. MUCH MUCH better behaviour of keypress! I have ordered RGB to HDMI converter (ready to hack acording your guidance) as RF output is so blurry.
Now KEYPAD calibration is also displayed on LCD. The message changes as it was too long. Also the message is updated after each validated keypress.
Hi, something gone wrong. After update to last commit, there is no LCD init (no text just first row barrely visible rectangles). Output from terminal is:
Failed configuration file: /.config/OLED128x32.display Output device: LED activity. Failed configuration file: /.config/LCD_KEYPAD_SHIELD.display Output device: serial 115200. Failed configuration file: /.config/ROTARY_ENCODER.input Failed configuration file: /.config/LCD_KEYPAD_SHIELD.input Failed configuration file: /.config/TTP223_KEYPAD.input Failed configuration file: /.config/IR_REMOTE.input 0 2024-08-05 18:34 jason/ 0 0 2024-08-05 18:34 jason/ 0 0 2024-08-05 18:34 jason/
And ADC just from RIGHT key - 0.
Ok, let me check. What's not normal is there is no saving of those files.
Delete /.config and retry.
EDIT: you should not remove the SD then reinsert it when SD-MZ²CMT is powered. I notice It is not safe at all. I have no solution for that.
Still it does work for me:
Input device: serial 115200.
Failed configuration file: /.config/SERIAL.debug
Invalid or no configuration file: /.config/OLED128x32.display
Created configuration file: /.config/OLED128x32.display
Output device: LED activity.
Invalid or no configuration file: /.config/LCD_KEYPAD_SHIELD.display
Created configuration file: /.config/LCD_KEYPAD_SHIELD.display
Output device: LCD16X2 screen.
Output device: serial 115200.
Invalid or no configuration file: /.config/ROTARY_ENCODER.input
Created configuration file: /.config/ROTARY_ENCODER.input
Input device: rotary encoder.
Calibrating LCD_KEYPAD...
Press keys 0/5.
But then it goes wrong... Press keys 6/5.
EDIT: well, if I press button RESET and retry to press the whole 5 buttons, it works. So I guess I had some glitches (and a potential bug but since RESET can help here... it is not blocking)
Reformatted SD (works for both FAT32 or exFAT) and copy MZ-700 repository. Insert SD before powering MZ-SD²CMT. I got:
Input device: serial 115200.
Failed configuration file: /.config/SERIAL.debug
Invalid or no configuration file: /.config/OLED128x32.display
Created configuration file: /.config/OLED128x32.display
Output device: LED activity.
Invalid or no configuration file: /.config/LCD_KEYPAD_SHIELD.display
Created configuration file: /.config/LCD_KEYPAD_SHIELD.display
Output device: LCD16X2 screen.
Output device: serial 115200.
Created configuration file: /.config/ROTARY_ENCODER.input
Input device: rotary encoder.
Invalid or no configuration file: /.config/LCD_KEYPAD_SHIELD.input
Calibrating LCD_KEYPAD...
Press keys 0/5.
Calibrating LCD_KEYPAD...
Press keys 1/5.
280
Calibrating LCD_KEYPAD...
Press keys 2/5.
19A
Calibrating LCD_KEYPAD...
Press keys 3/5.
64
Press keys 4/5.
102
Calibrating LCD_KEYPAD...
Press keys 5/5.
0
Created configuration file: /.config/LCD_KEYPAD_SHIELD.input
Input device: LCD16X2 KeyPad.
+00 Enabled: 1
+01 Button Voltage [RIGHT ]: 0
+03 Button Voltage [UP ]: 64
+05 Button Voltage [DOWN ]: 102
+07 Button Voltage [LEFT ]: 19A
+09 Button Voltage [SELECT]: 280
Invalid or no configuration file: /.config/TTP223_KEYPAD.input
Created configuration file: /.config/TTP223_KEYPAD.input
Input device: TTP223 KeyPad.
+00 Enabled: 1
+01 Input Code #0: 5
+02 Input Code #1: 1
+03 Input Code #2: 2
+04 Input Code #3: 4
+05 Input Code #4: 3
+06 Input Code #5: 0
+07 Input Code #6: 0
+08 Input Code #7: 0
+09 Active: 0
Invalid or no configuration file: /.config/IR_REMOTE.input
Created configuration file: /.config/IR_REMOTE.input
0 2024-08-10 20:57 SHARP MZ-700/
And if I press RESET:
Input device: serial 115200.
Loaded configuration file: /.config/SERIAL.debug
Loaded configuration file: /.config/OLED128x32.display
Output device: LED activity.
Loaded configuration file: /.config/LCD_KEYPAD_SHIELD.display
Output device: LCD16X2 screen.
Output device: serial 115200.
Loaded configuration file: /.config/ROTARY_ENCODER.input
Input device: rotary encoder.
Loaded configuration file: /.config/LCD_KEYPAD_SHIELD.input
Input device: LCD16X2 KeyPad.
+00 Enabled: 1
+01 Button Voltage [RIGHT ]: 0
+03 Button Voltage [UP ]: 64
+05 Button Voltage [DOWN ]: 102
+07 Button Voltage [LEFT ]: 19A
+09 Button Voltage [SELECT]: 280
Loaded configuration file: /.config/TTP223_KEYPAD.input
Input device: TTP223 KeyPad.
+00 Enabled: 1
+01 Input Code #0: 5
+02 Input Code #1: 1
+03 Input Code #2: 2
+04 Input Code #3: 4
+05 Input Code #4: 3
+06 Input Code #5: 0
+07 Input Code #6: 0
+08 Input Code #7: 0
+09 Active: 0
Loaded configuration file: /.config/IR_REMOTE.input
0 2024-08-10 20:57 SHARP MZ-700/
Hi, Now I see the reason. Ive just deleted ".config" folder to initialize calibration. But there was ".config" file also created. After deleting the file it works! No need to format SD card. Nice! Thanks.
While I'm now using Arduino IDE 2.3.2, I plan to add loading/creation of specific files to configure the input/output modules. I started with LCD_KEYPAD_SHIELD input where you may need to change the voltage threshold for each button of the keypad.
The rational is to try to load a configuration file and retrieves the configuration as a simple binary file. If loading is unsuccessful or the file is not present, it is then created with default values.
If you need to tweak the configuration, you need to use an hexadecimal editor to edit it.