> For the complete documentation index, see [llms.txt](https://learn.pakronics.com.au/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.pakronics.com.au/primary/codey-rocky-ai-robot/tutorials/ir-remote.md).

# IR Remote

You can use your IR remote to control Codey Rocky. Customize your IR remote to be your Codey Rocky control.

## Add IR Remote Blocks

### 1. Make sure "Codey" is selected and click "+" in the blocks area.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-11-20-12.png)

### 2. From the pop-up Extension Center page, click "+" to add IR Remote blocks.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-28-07.png)

### 3. Go back to Edit page. You can find IR Remote category added to the block palette.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-28-36.png)

## Have Some Fun

Let's try out the new IR Remote blocks. We will make a simple project to control Codey Rocky with your IR Remote.

### 1. Drag a when Codey starts up block from the Events category to the Scripts area.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-48-36.png)

### 2. When up arrow button is pressed, we want Codey Rocky to move forward. We need to a if () then () block from the Control category, a IR Remote () pressed? block from the IR Remote category, and a move forward at power ()% for () secs block from the Action category.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-53-22.png)

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-53-29.png)

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-53-39.png)

### 3. When down arrow button is pressed, we want Codey Rocky to move backward. We need to a if () then () block from the Control category, a IR Remote () pressed? block from the IR Remote category, and a move backward at power ()% for () secs block from the Action category.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-56-57.png)

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-57-05.png)

### 4. When left arrow button is pressed, we want Codey Rocket to turn left. We need to a if () then () block from the Control category, a IR Remote () pressed? block from the IR Remote category, and a turn left at power ()% for () secs block from the Action category.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-58-55.png)

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-17-59-04.png)

### 5. When right arrow button is pressed, we want Codey Rocky to turn right. We need to a if () then () block from the Control category, a IR Remote () pressed? block from the IR Remote category, and a turn right at power ()% for () secs block from the Action category.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-18-00-06.png)

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-18-00-15.png)

### 6. Add a Control block forever.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/images/ir.png)

### 7. Click "Upload" to upload the program to Codey.

![](http://docs.makeblock.com/codeyrocky/en/tutorials/2018-12-05-09-51-28.png)

### 8. Press the buttons of your IR Remote and see how Codey Rocky moves.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://learn.pakronics.com.au/primary/codey-rocky-ai-robot/tutorials/ir-remote.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
