# Lighthouse Basic Signal

![](/files/-LpfAuhwQC48pMIg6EEX)

### Basic Functionality: If it is dark outside the  signal should stay on for 3 seconds and off for 1 seconds. If it is daylight outside, the signal should remain off.

To develop the algorithm: use the LED Grid to send your signal. However in the next  steps you will add an extended LED bulb

```
Repeat Forever
    if  light level is low
        turn on light signal
    else
        turn off light signal      
    
```

**TIP**: Signal will all the LED on full bright for ease - since we are going to change your signal from the LED Grid to an attached LED Bulb, there is no need to develop a complicated signal here.

Now that you are sending a signal based the "time" of day, it is time to modify the  signal to flash during the night for incoming ships to see.

> “If you close your eyes, no lighthouse can help you!” ― Mehmet Murat ildan

We want the signal to stay on for 3 seconds and turn off for 1 second, so you need to  modify the code when the light level is low.

```
if light level is low
    turn on light signal
    pause 3 seconds
    turn off light signal
    pause 1 second
```

**TIP:** the microbit doesn't measure time in seconds, it measures time in milliseconds

## Our code doesn't turn the light back on? So does the light only flash one time per night? Is there an error in our algorithm?

Your lighthouse should have its own unique signal, this helps navigating ships identify the lighthouse in the distance. Take a minute and design your own simple, yet unique flashing signal.

This algorithim and portions of this assignment taken directly from <https://sites.google.com/view/microbitofthings/2-simple-control-systems/6-lighthouse?authuser=0>


---

# 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://computational-thinking-in-room11.gitbook.io/room-112-dhs/software-development/lighthouse-project/lighthouse-basic-signal.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.
