This code is what allows the connection between the Arduino and Computer. This code gets the status from the server and sends it via terminal to an Arduino.
This code is limited to use data up to 999, further than that will raise an error. This is a work in progress and it is to be solved.
- Download the lastest version from releases in this repository or clone the repository using the following command:
git clone https://github.com/Shaking-Hands-Overseas/Arduino-Serial-Hand
- Install Necessary Dependencies using pip:
pip install pyserial
-
Connect your Arduino to your computer and through the Arduino IDE find the Serial Port. Also I recommend using my arduino firmware, but feel free to use whatever you prefer.
-
Open the code via your text editor and specify on the URL Variable your API URL
-
Go to the cnt_index and change it accordingly to your data.
-
Go to the num variable, where the string that will be sent to the arduino is created and modify it according to your data.
With the above should work just fine.
- Simplify the way in which the API settings are used into a single JSON File
- Add Support for Longer Numbers than 999