the EMG sensor sends out an INT value from 0 to 1023 the problem is its output is continues. when I used CoolTerm to get the data and save it as a TXT file its output is horizontal and is saved as such like this
123123
what I want the output to be is to output it vertically like
1
2
3
1
2
3
I cant find any guides online because I dont know how to ask that specific question.
There may be someone here that is familiar with Coolterm and can help you, but this is an Arduino forum so, no guarantee. Perhaps ask at the Coolterm forum.
What is CoolTerm?
Usually in a .txt file you have some symbol (delimiter) to keep values separate. That delimiter should be set to space ' ', comma ',', ' ; ' , or something else. It is missing in your print...
You might try 'EOL' as delimiter. Then your data wil be in one column...
its just something like a comparison I want one analogue input to be printed on one line separated by a comma so that I can convert it to a CSV file the problem is it doesn't print the outputs vertically it prints the output continuously so when I convert it on the Excel its output is printed per column in 1 row instead of all the values in 1 column like
312|213|417|213
instead of
312
213
417
213
It is a small L (l) not a big i (I).
It stands for printline. It prints what is in between () and then it prints a '\n'. So it will move to the next line.
You do a reading (analogRead); that gives you a number between 0 and 1023 (both included.
You print that (as text). Why do you want e.g. 1023 to be split over 4 lines (as requested in your opening post)? Or why do you want to represent 1023 as 1,0,2,3.
Each line represents a new reading of the sensor. Your (perceived?) problem has nothing to do with your sensor.
If you have 500 cents in your purse and I ask you to write down the number of cents in your purse, do you write
5
0
0
or do your write
5,0,0
or do you write
500
???
You can run the following test. Disconnect the sensor, power up the Arduino and open serial monitor. You will get some random numbers.
Next connect A1 to GND; reading should become zero (0).
Next connect A1 to 3.3V; assuming a 5V processor (e.g. Uno), your reading will become around 675.
Next connect A1 to 5V; only do this if your board indeed has a 5V processor. Your reading will become 1023.
simulated output
...
...
0
0
0
675
676
675
674
1022
1023
1023
etc
There will more than likely be a small variation in the numbers.
no sorry if its confusing I did not want to split the values that the analog reads.
in the serial monitor in the arduino it works as intended it prints out a value from 0 to 1023 then moves on to the next line. the problem is with how its being saved by coolterm. it saves a value from the output but does not move on to the next line it just saves it as if typing continuously without pressing enter key to move on to the next line.
maybe I will just try using another tool to save the values. this may have been a coolterm problem and not an Arduino problem. thank you
You're right. Serial.println() always sends CR and LF characters (0x13 0x10) as end of line, so Coolterm seems to be badly configured, stripping those away.
I don't use CoolTerm but I suppose OP sholud check what type of terminal emulation he's using, for this purpose the best choice is a "raw" one (e.g. pure ASCII, without any control characters).
Nothing to do with Arduino, anyway.
No offense intended, but you need to learn the tools that you use. I've installed coolterm now, encountered the same problem with some code that was in my Nano and had a look at the options.