![]() ![]() I fixed this and here is that updated Arduino code: After some review of my code, I realied I had foolishly plugged the dataline into a digital pin and not an analog. My sensor value didn’t change when dipped into water. SensorText.text = "Current Soil Moisture: " + sensorVal.ToString() + "%" Īnd it WORKED! I was getting Arduino sensor values in Unity! However, there was one major flaw. SensorVal = ((Mathf.RoundToInt(sensorVal * 100)) / 100) String fileData = System.IO.File.ReadAllText(destinationFile) String destinationFile = filePath + "1.txt" įile.Copy(sourceFile, destinationFile, true) Public const string filePath = "C:/Users/nicho/OneDrive/Desktop/CoolTerm Capture 15-55-02" Note that I got around the sharing violation by creating a copy of that file and opening the copy as opposed to the original, then after getting the data, I deleted the copy. I followed an example here and came up with this code: I needed to modify my code to get around this. Which I knew from previous experience meant I was trying to open an already opened file. This however didn’t work and consistently gave me this error: String fileData = System.IO.File.ReadAllText(filePath) Public const string filePath = "C:/Users/nicho/OneDrive/Desktop/CoolTerm Capture 15-55-02.txt" By clicking the options below, it was able to write to the text file:Īnd it sucsesfully put that text into a text file:Īnd with that I added special chars to the start of the data so I would be able to parse it later. This video lead me to a program called CoolTerm, which can be downloaded FOR WINDOWS here.Īnd it WORKED and the reader was reading the serial data CORRECTLY. ![]() Some of the info was lost, which meant it would be impossible to parse. With my previous Serial to TXT, it only read a few bits at a time, which is not what I wanted. Serial.println("&" + currentSoilMoisture + "&") Īnd was able to get serial readings. ![]() It comes in both 32-bit and 64-bit downloads.CurrentSoilMoisture = currentSoilMoisture + analogRead(soilMoisturePin) ĬurrentSoilMoisture = currentSoilMoisture/100.0 Previous versions of the OS shouldn't be a problem with Windows 8 and Windows 7 having been tested. What version of Windows can CoolTerm run on?ĬoolTerm can be used on a computer running Windows 11 or Windows 10. is the latest version last time we checked. Download and installation of this PC software is free and 2. Sending data via pasting of text into the terminal window.ĬoolTerm is provided under a freeware license on Windows from network software with no restrictions on usage.Sending data via keypresses as well as a "Send String" dialog that support data entry in textual or hexadecimal format.Local echoing of received data (loop back to sender).Hardware (CTS, DTR) and software flow control (XON).Display of received data in textual or hexadecimal format.Capability of recording received data to text files.Capability of multiple concurrent connections if multiple serial ports are available.Capability of manually toggling RTS and DTR signals when hardware flow control is disabled.Capability of loading and saving connection options.Exchange text and other data between connected serial portsĬoolTerm was developed as a useful and user-friendly software and acts as a serial port terminal application.ĬoolTerm is a tool that's geared towards hobbyists and professionals with a need to exchange data with hardware connected to serial ports such as servo controllers, robotic kits, GPS receivers, microcontrollers etc. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |