> 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.
