Mohajerani-Lab / touchscreen-chamber-unity

MIT License
0 stars 0 forks source link

Touchscreen Chamber Unity Project

This Unity-based project, developed by the Mohajerani Lab, is designed for operant conditioning experiments with touchscreen-enabled behavioral studies in rodents. The Unity application interfaces with a Raspberry Pi running the PiController project to enable seamless control of connected hardware, including stimuli presentation and reward dispensing.

Table of Contents

Overview

The Touchscreen Chamber Unity Project operates as the central software interface for conducting experiments. This project leverages a PI controller on a Raspberry Pi for hardware control, allowing the Unity application to control and monitor various peripherals connected to the Raspberry Pi (e.g., touchscreens, reward dispensers). When deployed together on the same network, this Unity project can communicate with the PiController to execute experimental protocols with precise control over all hardware components.

Features

Requirements

Installation

You have two options to set up the application:

Option 1: Clone and Build

  1. Clone this repository:

    git clone https://github.com/Mohajerani-Lab/touchscreen-chamber-unity.git
  2. Open this project in Unity 2021.3.8f1.

  3. Make any necessary changes to the project to suit your experimental requirements.

  4. Build the project as an APK file for Android deployment. Go to File > Build Settings, select Android, and then Build.

  5. Deploy the APK to a compatible tablet. This project has been tested on a Samsung Galaxy Tab A 8.0 SM-T350.

Option 2: Download the Pre-built APK

  1. Download the latest APK from the releases page.

  2. Transfer the APK to your tablet and install it.

  3. Ensure the Unity app and PiController are both connected to the same network to enable communication.

PiController Integration

The Unity application communicates with the PiController on the Raspberry Pi to manage hardware components. This setup enables the Unity app to issue commands to the Pi for real-time control of devices like reward dispensers or sensors. The PiController project serves as a bridge to control and monitor hardware directly.

Usage

  1. Setup the Chamber Configuration: Adjust experiment parameters in Unity.

  2. Connect to PiController: Ensure the Unity app can connect to the PiController over the network.

  3. Run Experiment: Press Play in Unity to initiate the experiment. Unity will send commands to the PiController for real-time control of peripherals.

  4. Data Collection and Export: Experimental data is saved within Unity’s designated output folder.

Project Structure

Contributing

Contributions are welcome. Follow these steps:

  1. Fork this repository.
  2. Create a branch (git checkout -b feature-name).
  3. Commit changes (git push origin feature-name).
  4. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For more information, please contact the Mohajerani Lab.