Update Usage authored by Felix Kopp's avatar Felix Kopp
Using the seven segment display driver is rather simple: You can display hex numbers from `0x0` to `0xF` by writing the corresponding **ASCII character** (**not** the raw number!) into the character device file located at `/dev/sevenseg`. Example usage: Using the seven segment display driver is rather simple: You can display hex numbers from `0x0` to `0xF` by writing the corresponding **ASCII character** (**not** the raw number!) into the character device file located at `/dev/sevenseg`. The character recognition is case-insensitive, so you can write both `a` and `A`, for exmple.
```bash ```bash
root@raspberrypi:~# echo 3 > /dev/sevenseg root@raspberrypi:~# echo '3' > /dev/sevenseg
``` ```
This command makes the display show the number `3`, as you most probably figured out on your own. If you want to ensure everything is working fine, you can execute the test script included in the project's root directory: This command makes the display show the number `3`, as you most probably figured out on your own. You can also leave the quatation marks `'` out, but we consider this to be bad style. If you want to ensure everything is working fine, you can execute the test script included in the project's root directory:
```bash ```bash
root@raspberrypi:~/SevenSegController# chmod +x test.sh # Has to be made executeable first root@raspberrypi:~/SevenSegController# chmod +x test.sh # Has to be made executeable first
root@raspberrypi:~/SevenSegController# ./test.sh root@raspberrypi:~/SevenSegController# ./test.sh
``` ```
The script will check if the module is loaded correctly. If this is the case, it will automatically count from `0x0` to `0xF`, displaying every number for one second. Remember you have to run the script as root. The script will check if the module is loaded correctly. If this is the case, it will automatically count from `0x0` to `0xF`, displaying every number for one second. After that, the display is turned off again. Remember you have to run the script as root.
\ No newline at end of file \ No newline at end of file