Skip to content

Commit 1f794ed

Browse files
committed
Add APP
1 parent 8b2b0d1 commit 1f794ed

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
# UC2Serial Android App
3+
4+
The **UC2Serial** app is a control interface for managing various hardware components of a modular microscopy or optical system, specifically using serial communication protocols. The app provides intuitive controls for adjusting motor positions across multiple axes, controlling LED and laser intensities, and configuring communication settings.
5+
6+
You can find the APP in the following repository (including the release APK): https://github.com/openUC2/UC2Serial
7+
8+
## Features
9+
- **Motor Control**: Allows precise control over the A, X, Y, and Z motor axes with coarse and fine adjustments.
10+
- **LED Intensity Control**: Adjusts the intensity of LED lighting used in the optical setup.
11+
- **Laser Intensity Control**: Provides control over multiple laser channels for applications requiring specific lighting conditions.
12+
- **Serial Communication Configuration**: Configures the serial connection parameters, such as baud rate and read mode, for communication with connected hardware.
13+
14+
![](./IMAGES/uc2serialapp.jpeg)
15+
16+
## APK File
17+
18+
You can download the file from the source repository: https://github.com/openUC2/UC2Serial/releases/tag/v0.1
19+
20+
## User Interface Overview
21+
The app’s interface includes:
22+
1. **Axis Controls (A, X, Y, Z)**: Each axis has controls for coarse and fine motor adjustments.
23+
2. **LED Slider**: A seek bar to adjust the intensity of the LED lighting.
24+
3. **Laser Sliders**: Three individual sliders to control the intensity of different laser channels.
25+
4. **Serial Communication Settings**: Options to set baud rate and read mode for serial data transmission.
26+
27+
## Requirements
28+
- **Android Device**: The app runs on Android devices.
29+
- **USB or Bluetooth Connection**: Requires a serial communication link (USB or Bluetooth) to control the hardware.
30+
- **Connected Hardware**: A compatible hardware setup that accepts serial commands for controlling motors, LEDs, and lasers.
31+
32+
## Setup and Configuration
33+
34+
### 1. Installing the App
35+
1. Download and install the app APK on your Android device.
36+
2. Open the app and connect your device to the compatible hardware setup (e.g., via USB or Bluetooth).
37+
38+
### 2. Configuring Serial Communication
39+
1. **Baud Rate**: Select the appropriate baud rate (e.g., 9600, 115200) from the configuration screen. This should match the baud rate supported by your hardware.
40+
2. **Read Mode**: Choose between different read modes:
41+
- **Event-based**: Data is received through an event callback (`SerialInputOutputManager.onNewData()`).
42+
- **Direct**: Data is directly read through `UsbSerialPort.read()`.
43+
44+
### 3. Using the Axis Controls
45+
1. **A, X, Y, Z Axis Buttons**: Each axis section includes four buttons:
46+
- `--`: Large decrement for coarse adjustment in the negative direction.
47+
- `-`: Small decrement for fine adjustment in the negative direction.
48+
- `+`: Small increment for fine adjustment in the positive direction.
49+
- `++`: Large increment for coarse adjustment in the positive direction.
50+
51+
2. Tap the respective buttons to move the connected motor in the selected axis. The `MainActivity` sends specific commands based on button presses.
52+
53+
### 4. Adjusting LED Intensity
54+
1. Use the **LED Intensity** slider to control the brightness of the LED lighting.
55+
2. Slide to the right to increase intensity and to the left to decrease it.
56+
3. Intensity values are sent via serial commands to adjust the lighting in real time.
57+
58+
### 5. Controlling Laser Channels
59+
1. Each **Laser Intensity** slider controls a different laser channel.
60+
2. Move each slider to set the desired laser intensity for each channel.
61+
3. Laser intensity changes are sent via serial commands to the hardware, adjusting lighting conditions as needed.
62+
63+
## Code Overview
64+
65+
### Main Components
66+
- **`MainActivity.java`**: Sets up the UI, connects to the Toolbar, and initializes the serial connection. Manages button actions and serial data exchange with hardware.
67+
- **`ControlFragment.java`**: Houses the main controls for axis movement, LED, and laser adjustments. Sends commands for each control interaction using the `send()` method, which constructs serial commands based on user input.
68+
- **`styles.xml`**: Defines the app’s theme, including color schemes for the ActionBar and various UI components.
69+
- **`fragment_control.xml`**: Contains the layout for axis controls, LED intensity slider, and laser controls. Uses color themes and design specifications to provide an intuitive UI.
70+
71+
### Command Structure
72+
Commands are constructed in the following format:
73+
- **Motor Commands**: Sent with parameters specifying the axis, direction, and movement type (coarse or fine).
74+
- **LED and Laser Commands**: Sent with intensity levels to set the lighting for each source.
75+
76+
### Customizing Commands
77+
The command structure can be adapted within `getMotorControlDict()` and similar methods if specific adjustments or additional controls are required for your hardware setup.
78+
79+
## Troubleshooting
80+
- **Connection Issues**: Ensure that the Android device is properly connected to the hardware and that the baud rate matches the hardware settings.
81+
- **Axis Not Moving**: Check serial communication settings, as an incorrect baud rate or read mode can prevent commands from reaching the hardware.
82+
- **Lighting Controls Not Responding**: Verify that the hardware is receiving commands correctly and that intensity values are within the expected range.
83+
84+
## Future Improvements
85+
- **Feedback Integration**: Display real-time feedback from the hardware (e.g., motor position or light intensity levels).
86+
- **Additional Control Options**: Add features for more advanced control over hardware components, such as rotation angles or laser modulation.
87+
- **Customization**: Enable users to save configurations for quicker setup with different hardware.
94.1 KB
Loading

0 commit comments

Comments
 (0)