# Arduino_Master_Delta(AMD) Version 2.1
![introPic](https://github.com/SayadPervez/AMD--TUTORIAL/blob/master/IntroPic.png?raw=true)
![introPic](https://github.com/SayadPervez/Arduino_Master_Delta/blob/master/Trust%20me%20both%20are%20same.JPG?raw=true)
___
# What's the difference between Alpha and Delta Versions ?
#### >>> Alpha version provides ` easier but approximate ` interface for data extraction and Visualization **_(Since X values are automatically generated and fit enables only approximation of the data plotting)_**.
#### >>> Delta version of Arduino_Master is designed to deliver `accurate visualization` and hence a bit more complex than Alpha versions.
#### >>> To ease using of functions, Delta version uses a specific type of input called `hybrid` to represent both the X and Y values of a given plot with just one variable.
#### >>> Default plotting style is 'dark_background' unlike 'ggplot' of Alpha.
#### >>> Link to Arduino_Master (Alpha Version) [Arduino_Master_Alpha](https://pypi.org/project/Arduino-Master/)
___
___
# What's New in 2.1 ?
#### >>> Bugs related to readSerial, writeSerial and dynamicSerial fixed.
#### >>> **`farFrom`** and **`minDeviation`** parameters added to **`filter`** function.
#### >>> Bugs in filter function that prevented the use of farFrom, closeTo, maxDeviation and minDeviation parameters together **_rectified_**.
#### >>> **`compress()`** function updated to work with hybrids too !! (Version-0.9.2)
#### >>> 'avg' can also be passed to **`closeTo`** parameter of the filter function !! (Version-1.2)
#### >>> **`below`** and **`above`** parameters added to filter function ! (Version-1.3)
#### >>> 9 new data science functions added !! (Version-1.4)
#### >>> hybridize function updated to check if both index and amplitude lists have equal number of elements ! (Version-1.5)
#### >>> **`equiAxis'** parameter added to Graph, compGraph and visualizeSmoothie functions !!! (Version-1.5)
#### >>> Font Bug in plotting functions **_rectified_** !! (Version-1.6)
#### >>> The debugging of the previuos bug which I cleared out in Version 1.6 gave some more bugs, I got it **_rectified_**. You guys know about this, You are programmers !! (Version-1.7)
#### >>> Change 1.6 as 1.7 in my previous point.Checked it, everything is fine to go now ! (Version-1.8)
#### >>> Included docstrings and compatibility checked with all operating systems and jupyter notebook ! (Version-2.0)
#### >>> Functions like densePop, scarcePop, remImp, detectImp, cleanImpulses, reduce, instAvg, smoothie, Graph, compGraph and visualizeSmoothie modified to work even if you pass a list at the place of a hybird. But for accurate Data visualizations I'd recommend using hybrids. However all those functions returns hybrids alone as usual. Maximum error tolerance from this version !!!!!!!!!!!!!!!!!! (Version-2.1)
___
___
### AMD tutorial in this link -> [tutorial](https://github.com/SayadPervez/AMD--TUTORIAL/blob/master/README.md)
___
___
# Intro:
#### Embedded C is used to program microcontrollers like Arduino. However embedded C could never compete with Python's simplicity and functionality. Also Arduino being a microcontroller, we get a lot of garbage values which we require to filter before utilizing. This module eases the process of extracting and passing data to Arduino via Serial communication.
#### This Module also provides Easy and flexible Data Science functions for Data extraction, filtering, removing garbage values and Data Visualization !
___
___
# Installing via pip:
### Use the following command to install Arduino_Master using pip.
### **`pip install AMD`**
___
___
# Automatic Installation of other required Modules:
#### This module requires two more packages namely **`pyserial`** and **`matplotlib`**. Yet just by importing this module using the import statement or by using any function, unavailable modules will be installed and imported automatically. Make sure you have good internet connection and if still you get ModuleNotFound error, try installing these two modules manually via pip.
___
___
# Importing Functions:
#### **`from AMD import *`** statement is used to import all available functions from Arduino_Master. This version contains the following functions which we'll be discussing shortly. These functions can be grouped into 2 categories:
#### >> For Extracting and Writing data to Arduino:
#### $ ardata
#### $ readSerial
#### $ writeSerial
#### $ dynamicSerial
#### >> Data Science enabled functions for filtering and visualizing Data:
#### $ hybridize
#### $ Graph
#### $ compGraph
#### $ horizontal
#### $ vertical
#### $ marker
#### $ most_frequent
#### $ least_frequent
#### $ compress
#### $ filter
#### >> From Version 1.4 and higher !
#### $ densePop
#### $ scarcePop
#### $ remImp
#### $ detectImp
#### $ cleanImpulses
#### $ reduce
#### $ instAvg
#### $ smoothie
#### $ visualizeSmoothie
___
___
# ardata():- **`Returns a list`**
#### ardata function is used to communicate with the arduino via Serial. This function returns a list of values available in the Serial port.
#### **`ardata(COM ,lines= 50 ,baudrate= 9600 ,timeout= 1 ,squeeze= True ,dynamic= False ,msg= 'a' ,dynamicDelay= 0.5, numeric= True )`** is the function header.
___
## COM
#### **`COM`** parameter is used to specify the COM port to which arduino is connected to. You can pass either an integer or a string specifying the COM port.
### Eg:
```python
# COM parameter usage:
data = ardata(8) # or
data = ardata('COM=8')
#This will be interpreted as COM8
# If your COM port's name is not in this format, use the following:
data = ardata("YOUR_COM_PORT_NAME") #or
data = ardata('COM=YOUR_COM_PORT_NAME')
```
___
## lines
#### **`lines`** denotes the number of data units or lines it reads from the Serial monitor of Arduino. The default value is set to **50** which can be changed. Note that based on another parameter **`squeeze`**, the number of elements in the list this function returns might be lesser than the that of actual data.
___
## baudrate
#### **`baudrate`** parameter is used to specify the baudrate at which the Serial communication occurs at. The default value is **9600** which is the most widely used baudrate.
___
## timeout
#### **`timeout`** is used to specify the timeout value in seconds. The default value is **1**.
___
## squeeze
#### **`squeeze`** is used to specify if the data needs to be compressed. This uses a function from data science part of this module **`compress()`** which is used to remove **_repeated and sequential_** set of data with a single piece of data.
### Eg:
```python
# Consider the following list of data:
data = [ 1 , 2 , 2 , 2 , 3 , 3 , 5 , 1 , 1 , 2 , 5 , 5 ]
info = compress(data)
print(info)
# This will print [ 1 , 2 , 3 , 5 , 1 , 2 , 5 ]
```
#### **`squeeze`** uses the same function and takes either True (or) False boolean values as parameters. By default, this parameter is set to **True**. Referencing the above example code, if squeeze is set to **False**, ardata will return **data** and if it is set to **True** which is the default setting, it will return **info**.
___
## dynamic
#### **`dynamic`** is used to specify if the Serial communication is just to read from the serial port or for both reading and writing to the serial port. The default value is **false** which means you can only read from the Serial port. If dynamic is set to true, the string from the **`msg`** parameter will be written to the Serial port every time before reading a value.
___
## msg
#### **`msg`** parameter specifies the message that is to be written in the serial monitor. the default value is **'a'**. *It is a must to pas this parameter if dynamic is set to true.*
___
## dynamicDelay
#### **`dynamicDelay`** is used to specify the time this program has to wait after writing a value to the console and to start reading from the COM port. It is experimentally determined that a delay of 0.5 seconds is mandatory in order to prevent overlapping of passed message
PyPI 官网下载 | AMD-2.1.tar.gz
版权申诉
5 浏览量
2022-01-11
14:43:05
上传
评论
收藏 43KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 51单片机2个I/O口扫描5个按键方案 附程序仿真
- Python 教程 — Python 3.10.6 文档.lnk
- 基于Springboot的广场舞团(有报告) Javaee项目,springboot项目
- C#-asp.net-003 学生成绩管理系统源码(含sql数据库)
- tensorflow-2.8.2-cp310-cp310-win-amd64.whl
- tensorflow-2.8.1-cp39-cp39-win-amd64.whl
- Thinkphp微信夹娃娃蓝色源码.zip
- 12V电源平面对DDR4信号的影响-林楷智.pdf
- 基于Cadence-All...PCB信号完整性分析与设计-巫玲.pdf
- tensorflow-gpu-2.8.2-cp310-cp310-win-amd64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈