User Tools

Site Tools


test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
test [2021/10/06 11:15] – [Encoders] ursgraftest [2026/05/20 11:35] (current) ursgraf
Line 13: Line 13:
  
 ==== Encoders ==== ==== Encoders ====
-ssh into the BeagleBone blue board and run:+Enable the counters with:
 <code> <code>
-ost@bblue:$ sudo rc_test_encoders +ost@bblue:echo 1 | sudo tee /sys/bus/counter/devices/counter1/count0/enable  
 +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter2/count0/enable  
 +ost@bblue:$ echo 1 | sudo tee /sys/bus/counter/devices/counter3/count0/enable 
 </code> </code>
-If you move the axis you should see encoder values changing.  +The counter0 does not have to be enabledThen watch the counters with
-==== LEDs and buttons ==== +
-Next we want to check if all leds and buttons work as desiredChange to root mode +
 <code> <code>
-ost@bblue:su+ost@bblue:watch -n 0.5 cat /sys/bus/counter/devices/counter0/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter1/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter2/count0/count  
 +ost@bblue:$ watch -n 0.5 cat /sys/bus/counter/devices/counter3/count0/count 
 </code> </code>
-The password is "root"Change into +If you move the axis you should see counter values changing 
 + 
 +==== LEDs and buttons ==== 
 +Next we want to check if all leds and buttons work as desired. 
 +The blue led should light up on pin GPIO3_2 with 
 <code> <code>
-root@bblue:cd /sys/class/gpio+ost@bblue:sudo gpioset -c gpiochip2 2=1
 </code> </code>
-and add the pins involved to the gpio array with+Do the same with the red led on pin GPIO1_17 
 <code> <code>
-root@bblue:echo 49 > export +ost@bblue:sudo gpioset -c gpiochip0 17=1
-root@bblue:$ echo 57 > export +
-root@bblue:$ echo 97 > export +
-root@bblue:$ echo 98 > export +
-root@bblue:$ echo 113 > export +
-root@bblue:$ echo 116 > export+
 </code> </code>
-The blue led should light up with +And the green led on pin GPIO3_20
 <code> <code>
-root@bblue:echo out > gpio98/direction +ost@bblue:sudo gpioset -c gpiochip2 20=1
-root@bblue:$ echo > gpio98/value +
-</code> +
-and stop lighting with +
-<code> +
-root@bblue:$ echo 0 > gpio98/value +
-</code> +
-Do the same with the red led +
-<code> +
-root@bblue:$ echo out > gpio49/direction +
-root@bblue:$ echo 1 > gpio49/value +
-root@bblue:$ echo 0 > gpio49/value +
-</code> +
-And the green led +
-<code> +
-root@bblue:$ echo out > gpio116/direction +
-root@bblue:$ echo 1 > gpio116/value +
-root@bblue:$ echo 0 > gpio116/value+
 </code> </code>
 Read the state of the blue button with Read the state of the blue button with
 <code> <code>
-root@bblue:echo in > gpio97/direction +ost@bblue:sudo gpioget -c gpiochip2 1
-root@bblue:$ cat gpio97/value+
 </code> </code>
-Repeat the last command with the button pressed. Do the same with the red button+When the button is pressed it will return //"1"=active//, //"1"=inactive// otherwise. Do the same with the red button
 <code> <code>
-root@bblue:echo in > gpio57/direction +ost@bblue:sudo gpioget -c gpiochip0 25
-root@bblue:$ cat gpio57/value+
 </code> </code>
 And the green button And the green button
 <code> <code>
-root@bblue:echo in > gpio113/direction +ost@bblue:sudo gpioget -c gpiochip2 17
-root@bblue:$ cat gpio113/value +
-</code> +
-Exit root mode with +
-<code> +
-root@bblue:$ exit+
 </code> </code>
  
test.1633511718.txt.gz · Last modified: by ursgraf