Tutorial 1 — Hello World Blink

Your first CupCarbon project: one IoT node that blinks and displays “Hello” and “World!”

Level: beginner  •  Duration: ~10 minutes  •  CupCarbon Klaines 8.0
Video Before you start 1. New project 2. Add an IoT node 3. Write the script 4. Assign it 5. Run 6. Stop & save The code explained Troubleshooting

Watch the tutorial

Player not loading? Watch the tutorial directly on YouTube.

Prefer reading? Every step is written below — the video simply follows the same order.

Before you start

You need CupCarbon Klaines 8.0 installed (installation guide) and Python 3 available on your machine — IoT nodes run real Python scripts. Check it in a terminal with python3 -V.

CupCarbon does not need Python to start; it needs it only to execute the programs of the IoT nodes. If your scripts do not run later, set the Python command in Executor Path Configuration (toolbar) — usually python3.

Create a new project

  1. Start CupCarbon.
  2. Menu Project → New project (or the New project icon of the toolbar).
  3. Choose a folder and a name, for example tutorial1, then validate.

CupCarbon creates a folder containing everything about your scenario: config/ (the nodes), scripts/ (the programs), gps/ (the routes), results/, agents/ (the AI workflows)... The title bar now shows the project name.

Add an IoT node

  1. Press the key 3 (or menu Add → Add IoT Node): the cursor becomes a hand.
  2. Click on the map where you want the node — it appears with the id 1.
  3. Right-click (or press esc) to stop adding nodes.

The two circles around the node are its radio range and its sensing range. Its center is gray: no program is assigned yet.

One environment per project. A project contains either IoT nodes (Python, this tutorial) or classical WSN sensor nodes (SenScript) — never both. The type is displayed at the bottom-left corner of the map: it now shows IoT.

Write the Hello World program

Open the Program editor from the toolbar and type:

from cup_functions import *

while True:
    cup_mark()
    cup_print('Hello')
    cup_wait(1)
    cup_unmark()
    cup_print('World!')
    cup_wait(1)

Type hello_world.py in the File name field and click Save. The file is created in the scripts/ folder of your project and appears in the script list.

The editor highlights the syntax, inserts 4 spaces when you press Tab, and lists every cup_* function on the right — double-click one to insert it, and click Help for its description and three examples. If you saved without an extension, CupCarbon adds .py automatically.

Assign the program to the node

  1. Close the editor and select the node on the map (one click).
  2. In the left panel, open Device Parameters.
  3. In the Script file field, choose hello_world.py.
  4. Click Apply (the button on the right of the field).

The center of the node turns orange: it now has a program.

Run the simulation

Click Run Simulation (toolbar or left panel). The node starts its Python script:

A red frame around the map and the simulated time in the top-left corner indicate that the simulation is running.

Stop and save

Click Stop Simulation, then save your project (Project → Save or the save icon). Your scenario — the node, its program and its position — is stored in the project folder and can be reopened, zipped or shared as is.

The code explained

There are 30 cup_* functions: movement, GPS routes, sensing, node-to-node messaging, and the bridge to the agentic AI workflows. The complete list is in the help and in the user guide.

Troubleshooting

Next steps

Now that your first node lives, try: two nodes exchanging messages (cup_send / cup_read), a mobile node following a GPS route, or an AI agent driving your network from the Agentic AI workflows.