# Count-by-Count Activity

## Introduction

This activity is intended to provide additional practice with using the touch sensor by completing a simple task. Students will build a small servo “gate” regulating the entrance into an area. To raise the gate, the touch sensor must be pressed, but once a max number is pressed no more entries will be allowed.&#x20;

Consider pairing this activity with students building a diorama of their gated area. Examples might include a museum, lunch room, theater, or store. This lesson may also be tied with classes introducing CAD, or safety and accessibility standards for buildings.

<figure><img src="/files/fMd4reNRofZIS7oTku1C" alt="" width="375"><figcaption><p>Example gate build for the Count-by-Count Activity</p></figcaption></figure>

### Covered Concepts

* Touch Sensor
* If/Else logic
* Loops
* ElapsedTime
* Servo usage
* Programming angular limits on a servo with the SRS Programmer

### Curriculum Connections

* Intro to Robotics V2 - Unit 4, Lesson 25&#x20;
* Intro to Robotics V2 - Unit 5, Lesson 29 (ElapsedTime)

### Activity Goals

Students will:

* Utilize the touch sensor in a practical scenario mimicking a real-life use case
* Practice programming a touch sensor&#x20;
* Create a program that uses a count to track how many times the touch sensor has been pressed and that uses a timer to reset once the max is reached

## Activity Files

### Teacher Files

{% file src="/files/v50FupCDsgfhCMHsNWSy" %}

### Student Files

**Student Activity Worksheet:**

{% file src="/files/sFLu9ADUI92Zu303mZSU" %}

**Programming Guide:**

{% file src="/files/4itlYAkqaXmWZkA4IMKQ" %}

**\[Optional] Programming Guide for two touch sensors:**

{% file src="/files/rRX3NS4O4lpPCJ8JGsfw" %}


---

# 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://docs.revrobotics.com/classroom-activities/programming-focus/count-by-count.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.
