/ docs / src / usage.md
usage.md
  1  # How to use ComChan
  2  
  3  Currently in the latest version, ComChan has the following features
  4  
  5  1. [Basic Serial Monitor](#basic-serial-monitor)
  6  2. [Verbose Mode of Basic Serial Monitor](#verbose-mode)
  7  3. [Logging data into a file](#logging)
  8  
  9  ## Basic Serial Monitor
 10  
 11  ComChan can be used as a basic serial monitor for EMbedded Applications. 
 12  
 13  In the Basic Serial Monitor mode, it has Read/Write capabilities. 
 14  
 15  Here is a GIF showing how it works in basic mode : 
 16  
 17  ### Video 1 (Hello World printing)
 18  
 19  We will run a basic Arduino application that continuously prints **Hello World**
 20  
 21  **Apparatus Used**: 
 22  1. Arduino Uno
 23  2. ComChan
 24  
 25  **Configuration**
 26  1. Port: /dev/ttyACM0 (for Linux) **OR** COM3 (for windows)  (can be any number)
 27  2. Baud Rate: 9600
 28  
 29  **Command Used** :
 30  
 31  ```bash
 32  comchan -p <port> -r <baud_rate>
 33  ```
 34  
 35  <br>
 36  
 37  ![Basic mode Hello World](./videos/basic_serial_mon.gif)
 38  
 39  <br>
 40  
 41  ### Video 2 (User Input)
 42  
 43  We will now run another Arduino Application that takes User Input (1 or 0) to turn on and off the LED. 
 44  
 45  **Working**: 
 46  
 47  When the user types `on` or `ON`, the LED on the Arduino Turn ON and when the user types `off` or `OFF`, the LED turn OFF. 
 48  
 49  Here are the GIF's :
 50  
 51  <br>
 52  
 53  <img src="./videos/basic_user_input.gif" width = "900">
 54  
 55  <br>
 56  
 57  <video controls width = "900">
 58      <source src="./videos/arduino.mp4" type="video/mp4">
 59  </video>
 60  
 61  ## Verbose Mode
 62  
 63  **Command Used** :
 64  
 65  ```bash
 66  comchan -p <port> -r <baud_rate> -v 
 67  
 68  # OR 
 69  
 70  comchan --port <port> --baud <baud_rate> --verbose
 71  ```
 72  
 73  
 74  ComChan also has a verbose mode where the timestamps are available.
 75  
 76  The time stamps the time in milliseconds since January 1 1970 (Unix Epoch). 
 77  
 78  Here is the GIF
 79  
 80  <img src = "./videos/verbose_serial_mon.gif" width = "900">
 81  
 82  <br> 
 83  
 84  ## Logging
 85  
 86  **Command Used** : 
 87  
 88  ```bash
 89  comchan -p <port> -r <baud_rate> -l <file_name>.log
 90  
 91  # OR 
 92  
 93  comchan --port <port> --baud <baud_rate> --log <file_name>.log
 94  ```
 95  
 96  Log Files can be used to access the Serial Monitor data on a later date to debug Embedded Applications.
 97  
 98  Here is the GIF of a Normal Serial Monitor
 99  
100  <img src = "./videos/logging_mon.gif" width = "900">
101  
102  Here is the GIF of a log file
103  
104  <img src = "./videos/logging_file.gif" width = "900">
105  
106  You can access the sample log file [here](https://github.com/Vaishnav-Sabari-Girish/ComChan/blob/main/test.log).