Pages: [1]   Go Down
Author Topic: SerialPrint colums  (Read 290 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino is the brain of the robot.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, i have a binch of ldr's hooked up to arduino's input pins 0-4. I want arduino to read the 4 sensors and print them. The real thing i want to is print each sensors data in a seperate colum. For example, Sensor 1 all the way to the left; sensor 2's data in the middles left; sensor 3's data in the middle to the right; then sensor 4's data all the way to the right. Please help me with this; maybe some code. Thanks!
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 572
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sure there's a much more elegant way, but I'd start with

Code:
Serial.print("Sensor 1 = ");
Serial.print(sensor1_val);
Serial.print("              Sensor 2 = ");
Serial.print(sensor2_val);
Serial.print("              Sensor 3 = ");
Serial.print(sensor3_val);
Serial.print("              Sensor 4 = ");
Serial.println(sensor4_val);
Logged

Pages: [1]   Go Up
Jump to: