Files
Arduino_Mini_Assignment/src/sketch.ino
T
Sam Perry 449f72ed03 Completed step 1
Created plot showing linearity of FSR over increasing pressure.
Added live plotting python script.
2016-10-01 11:23:07 +01:00

30 lines
431 B
Arduino

// analog-plot
//
// Read analog values from A0 and A1 and print them to serial port.
//
// electronut.in
#include "Arduino.h"
void setup()
{
// initialize serial comms
Serial.begin(9600);
}
void loop()
{
// read A0
int val1 = analogRead(0);
// read A1
int val2 = analogRead(1);
// print to serial
Serial.print(val1);
Serial.print(" ");
Serial.print(val2);
Serial.print("\n");
// wait
delay(50);
}