# Control Multiple HaloCodes via LAN

Multiple HaloCodes can join the same LAN (Local Area Network), and communicate with each other. We can use HaloCode to control others.

![](/files/-Lpg71govJszUnRGBdKC)

## Control HaloCode B with HaloCode A

### HaloCode A sets up LAN

1\. Connect HaloCode A

![](/files/-Lpg71gpaM6aOK6LIZUI)

2\. Enable Upload mode

![](/files/-Lpg71gq1Z9w074vsyQD)

3\. Add an Events block when HaloCode starts up, and a LAN block set up LAN named (mesh1)。

![](/files/-Lpg71gr7TywIgxN_4_V)

### HaloCode A broadcasts on LAN

4\. Add an Events block when button is pressed, and a LAN block broadcast () on LAN. Name the message "light"

![](/files/-Lpg71gsqPYlOiroy-Jg)

5\. Upload the program to HaloCode A

![](/files/-Lpg71gtQEGRLbXoH-G0)

### HaloCode B joins LAN

6\. Connect HaloCode B

![](/files/-Lpg71guAOUq1Axhmpc8)

7\. Enable Upload mode

![](/files/-Lpg71gv6wgVY7by5ywQ)

8\. Add an Events block when HaloCode starts up, and LAN block join LAN named (mesh1)

![](/files/-Lpg71gwBcYZzV1n5SMZ)

### HaloCode B receives LAN broadcast

9\. Add a LAN block when receiving LAN broadcast (), and input "light". Add a Lighting block all LEDs light up (), a Control block wait () seconds, and another Lighting block light off all LEDs

![](/files/-Lpg71gx0ECSIMyOjubk)

10\. Upload the program to HaloCode B

![](/files/-Lpg71gy9h4B6g742VqA)

### Programming result

11\. Press the button HaloCode A

![](/files/-Lpg71gzuIV3HBdmuecg)

**Challenge**

Challenge yourself. Can you make a new project like following example?

![](/files/-Lpg71h-MrRLEw_wGpLY)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.pakronics.com.au/halocode-1/code-with-mu-a-simple-python-editor/examples/basic-project/untitled-4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
