Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit d073bdb2 authored by Robert Nelson's avatar Robert Nelson
Browse files
parents ee26acdf a6d0ecf8
Branches
No related merge requests found
......@@ -148,9 +148,6 @@ Standalone w/Display and Keyboard/Mouse
Load "am57xx-eMMC-flasher-debian-9.13-lxqt-tidl-armhf-2020-08-25-6gb.img.xz"
image on the BeagleBone® AI
Presently, the "Cloud 9" application is broken in debian 10 only for
this configuration. We re working on a better solution.
1. Connect a combo keyboard and mouse to BeagleBone® AI’s USB host port.
2. Connect a microHDMI-to-HDMI cable to BeagleBone® AI’s microHDMI port.
3. Connect the microHDMI-to-HDMI cable to an HDMI monitor.
......
......@@ -236,8 +236,8 @@ server that is running on PocketBeagle). Copy the appropriate IP Address
from the chart (according to your PC operating system type) and paste
into your browser then add a **:3000** to the end of it. See example in
Figure 16 below. This will launch from PocketBeagle one of it's favorite
Web Based Development Environments, Cloud9 IDE, (Figure 17) so that you
can teach your beagle new tricks!
Web Based Development Environments, Visual Studio Code, (Figure 17)
so that you can teach your beagle new tricks!
.. figure:: images/16fig-PB-enablenetwork.png
:align: center
......@@ -245,53 +245,76 @@ can teach your beagle new tricks!
Enable a Network Connection
.. figure:: images/17fig-PB-cloud9.png
.. figure:: images/vscode1.png
:align: center
:alt: Launch Cloud9 IDE
:alt: Launch Visual Studio Code IDE
Launch Cloud9 IDE
Launch Visual Studio Code IDE
1. Get Started Coding with Cloud9 IDE - blinking USR3 LED in JavaScript
using the BoneScript library example
#. Get Started Coding with Visual Studio Code IDE - blinking USR LEDs in Python.
#. Create a new text file
#. Navigate to the code. Select ``examples/BeagleBone/Black/seqLEDs.py``.
.. image:: images/SRM1_cloud9blinkPB.png
.. image:: images/vscode2.png
Copy and paste the below code into the editor
The code should match the code below, if you can't find it, copy and paste the below code into the editor
.. code-block::
.. code-block:: python
var b = require('bonescript');
var state = b.LOW;
b.pinMode("USR3", b.OUTPUT);
setInterval(toggle, 250); // toggle 4 times a second, every 250ms
function toggle() {
if(state == b.LOW) state = b.HIGH;
else state = b.LOW;
b.digitalWrite("USR3", state);
}
#!/usr/bin/env python3
# ////////////////////////////////////////
# // seqLED.py
# // Blinks the USR LEDs in sequence.
# // Wiring:
# // Setup:
# // See:
# ////////////////////////////////////////
# // Tested: may: 2022.06.29 - BBB - 5.10.109-ti-r45
import time
import os
LEDs=4
LEDPATH='/sys/class/leds/beaglebone:green:usr'
.. image:: images/SRM2_cloud9blinkPB.png
# Turn off triggers
for i in range(LEDs):
# print(LEDPATH+str(i)+"/trigger")
f = open(LEDPATH+str(i)+"/trigger", "w")
f.write("none")
f.close()
.. image:: images/SRM3_cloud9blinkPB.png
# Open a file for each LED
f = []
for i in range(LEDs):
f.append(open(LEDPATH+str(i)+"/brightness", "w"))
Save the new text file as *blinkusr3.js* within the default directory
# Sequence
while True:
for i in range(LEDs):
f[i].seek(0)
f[i].write("1")
time.sleep(0.25)
for i in range(LEDs):
f[i].seek(0)
f[i].write("0")
time.sleep(0.25)
Execute
.. code-block::
Open a terminal by selecting ``Terminal/New Terminal``
(or pressing ``Ctrl+Shift+```) and execute the code:
node blinkusr3.js
.. image:: images/vscode3.png
within the default (/var/lib/cloud9) directory
.. code-block:: shell-session
bone:~$ cd ~/examples/BeagleBone/Black
bone:~$ ./seqLEDs.py
.. image:: images/SRM4_cloud9blinkPB.png
You will see the four USR LEDs flashing.
.. image:: images/vscode4.png
Type CTRL+C to stop the program running
Type CTRL+C to stop the program running.
.. _powering_down:
......
boards/pocketbeagle/original/images/vscode1.png

109 KiB

boards/pocketbeagle/original/images/vscode2.png

85.1 KiB

boards/pocketbeagle/original/images/vscode3.png

90.9 KiB

boards/pocketbeagle/original/images/vscode4.png

82.6 KiB

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment