Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

arduino-libraries/Arduino_CapacitiveTouch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The CapacitiveTouch Library is designed to simplify the use of capacitive touch sensors on Arduino UNO-R4 boards (Minima and WiFi). This library hides the low-level hardware details (CTSU, DTC, interrupts, etc.) and provides a simple, user-friendly API for beginners and educational projects.

Features

  • Easy to Use API:
    Initialize your sensor with just one constructor call and use simple methods to read sensor values and detect touches.
  • Board Support:
    Compatible with Arduino UNO-R4 Minima and UNO-R4 WiFi boards.
  • Low-Level Abstraction:
    All complex tasks (hardware setup, measurement control, interrupt management) are abstracted away so you can focus on your project.

Installation

  1. CopyCapacitiveTouch.h andCapacitiveTouch.cpp into your Arduino libraries folder.
  2. Restart your Arduino IDE so it recognizes the new library.

Compatible Pins

Arduino UNO-R4 Minima

Arduino PinTouch Sensor Channel (TS#)Channel Control Index (CHAC idx)Channel Control Bit Mask (CHAC val)
D091(1 << 1)
D181(1 << 0)
D2344(1 << 2)
D3131(1 << 5)
D8111(1 << 3)
D920(1 << 2)
D11101(1 << 2)
D13121(1 << 4)
A1 (D15)212(1 << 5)
A2 (D16)222(1 << 6)
LOVE_BUTTON00(1 << 0)

Arduino UNO-R4 WiFi

Arduino PinTouch Sensor Channel (TS#)Channel Control Index (CHAC idx)Channel Control Bit Mask (CHAC val)
D091(1 << 1)
D181(1 << 0)
D2131(1 << 5)
D3344(1 << 2)
D6121(1 << 4)
D8111(1 << 3)
D920(1 << 2)
D1170(1 << 7)
D1260(1 << 6)
A1 (D15)212(1 << 5)
A2 (D16)222(1 << 6)
LOVE_BUTTON273(1 << 3)

Note: Only the above pins are supported. Other pins are not configured for capacitive touch sensing.

Usage Example

#include"CapacitiveTouch.h"// Instantiate a capacitive touch sensor using the LOVE_BUTTON macro.CapacitiveTouch ct = CapacitiveTouch(LOVE_BUTTON);voidsetup() {  Serial.begin(9600);  ct.begin();  ct.setThreshold(500);// Adjust threshold (lower values increase sensitivity)  Serial.println("CapacitiveTouch Library: LOVE Button test");}voidloop() {int sensorValue = ct.read();  Serial.print("Raw Value:");  Serial.println(sensorValue);if (ct.isTouched()) {    Serial.println("LOVE button touched!");  }delay(100);}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp