# Oppgave 14: Trafikklys

I dette eksempelet vises "starten på" et trafikklys som blinker med rødt og grønt lys.

### Montering

![](/files/-LuIP0SZ5slSUNRT9xol)

* Koble til trafikklyset med 3 lysdioder
  * Rød lysdiode kobles med lang leder til P0 (kobberbane 0)
  * Gul lysdiode kobles med lang leder til P1 (kobberbane 1)
  * Grønn lysdiode kobles med lang leder til P2 (kobberbane 2)
* Alle de korte lederne på de 3 lysdiodene kobles til GND

### Program

{% embed url="<https://makecode.microbit.org/_U0R807Hch1xq>" %}

* MERK: Programmet viser kun hvordan du programmerer den røde og den grønne lysdioden til å blinke vekselsvis

### Prøv selv

1. Sjekk at programmet og koblingene fungerer slik at den røde og grønne lysdioden blinker hver sin gang.
2. Endre programmet så det etterligner et ekte trafikklys


---

# 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://oppgaver.n00b.no/micro-bit/kom-i-gang-med-micro-bit/oppgave-14-trafikklys.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.
