I have a Pocketbeagle2 with a breakout board & a joystick. I wanted to make another "trackpoint" mouse.
To start, I had to flash BeagleBone's Debian image onto a microSD card. I plugged my microSD card into my laptop & used lsblk to find the name of it. In my case, it was called mmcblk0, so I ran the following to download, decompress & flash the card:
The last line indicated to me that there is a TTY device available called ttyACM3, so I ran the following to get a TTY:
sudo picocom -b 115200 /dev/ttyACM3
I used the default username, debian, and password tmppasswd to log in & then proceeded to reset the password.
Since my goal was to use an analog joystick, I needed to figure out how to get the values from the analog pins, seen in the diagram below(P1.19, P1.21, P1.23, etc):
I had found a repository featuring example projects using the Pocketbeagle2. This file pointed me to an analog-to-digital converter device called ad7291 .
I found the device directory with grep ad7291 /sys/dev/char/*/name. In that directory, I found in_voltage[0-7]_raw. 8 files with number values in them:
I connected P1.19 to ground & saw in_voltage0_raw dip to 0. I connected in_voltage0_raw to the 3.3V & saw it reach 4000. This is exactly what I needed. I then wired everything up:
For controlling my laptops cursor, I was thinking of just writing some commands over SSH. For that, I needed to get them connected over IP over USB.
I saw that the USB device was given the IP 192.168.7.2/24
debian@BeagleBone:~$ ip -br a
lo UNKNOWN127.0.0.1/8::1/128
dummy0 DOWN
usb0 UP192.168.7.2/24 fe80::647:7ff:fe2d:cb76/64
docker0 DOWN172.17.0.1/16
So I gave my corresponding device(enp0s26u1u1) an address in the same subnet:
sudo ip addr add 192.168.7.1/24 dev enp0s26u1u1
sudo ip linkset up dev enp0s26u1u1
Once they were able to reach eachother over the network, I came up with the following script to take the analog values & control my laptop's cursor over SSH:
No comments yet. Be the first!