Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| docs:guide-developer:add.new.device [2021/10/15 09:06] – ↷ Links adapted because of a move operation bobafetthotmail | docs:guide-developer:add.new.device [2022/03/23 12:00] (current) – adding filename for scripts, so that when users post their result they will be able to refer a specific output associated with which script aterik | ||
|---|---|---|---|
| Line 44: | Line 44: | ||
| To speed up testing all GPIOs one by one you can use following bash script. Please note you have to follow LEDs state and console output. If the USB LED turns on and the last console message is '' | To speed up testing all GPIOs one by one you can use following bash script. Please note you have to follow LEDs state and console output. If the USB LED turns on and the last console message is '' | ||
| - | <code># | + | <file bash gpio-test.sh># |
| GPIOCHIP=0 | GPIOCHIP=0 | ||
| BASE=$(cat / | BASE=$(cat / | ||
| Line 66: | Line 66: | ||
| } | } | ||
| gpio=$((gpio+1)) | gpio=$((gpio+1)) | ||
| - | done</code> | + | done |
| + | </file> | ||
| + | * Save the above content as a file '' | ||
| + | * to make it executable, run: '' | ||
| ==== GPIO buttons ==== | ==== GPIO buttons ==== | ||
| Line 78: | Line 81: | ||
| For dumping GPIO values following script can be used: | For dumping GPIO values following script can be used: | ||
| - | <code># | + | <file bash gpio-dump.sh># |
| GPIOCHIP=0 | GPIOCHIP=0 | ||
| BASE=$(cat / | BASE=$(cat / | ||
| Line 92: | Line 95: | ||
| } | } | ||
| gpio=$((gpio+1)) | gpio=$((gpio+1)) | ||
| - | done</code> | + | done |
| + | </file> | ||
| + | * Save the above content as a file '' | ||
| + | * to make it executable, run: '' | ||
| If GPIO value changes from 1 to 0 while pressing the button, it's active low. Otherwise it's active high. | If GPIO value changes from 1 to 0 while pressing the button, it's active low. Otherwise it's active high. | ||