LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

ethylene sensor result from arduino into labview for graph reference. HELP!

int sensorPin = A0;    // select the input pin for the potentiometer
int sense2 = A1;      // select the pin for the LED
int sensorValue = 0;
int pump = 5;
float senseval = 0.0;
float volt;

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2


#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH  16
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{ B00000000, B11000000,
  B00000001, B11000000,
  B00000001, B11000000,
  B00000011, B11100000,
  B11110011, B11100000,
  B11111110, B11111000,
  B01111110, B11111111,
  B00110011, B10011111,
  B00011111, B11111100,
  B00001101, B01110000,
  B00011011, B10100000,
  B00111111, B11100000,
  B00111111, B11110000,
  B01111100, B11110000,
  B01110000, B01110000,
  B00000000, B00110000 };

void setup() {
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);
  pinMode(pump, OUTPUT);


 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  // init done
 
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();

}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  senseval = analogRead(sense2);
  volt = (senseval / 1024) * 5;
  Serial.print("Output:");
  Serial.println(sensorValue);
  Serial.print("RAW:");
  Serial.println(senseval);
  Serial.print("volt:");
  Serial.println(volt);
  delay(1000);
  {
    analogWrite (pump, 255);
    digitalWrite(pump, HIGH);
    delay(1000);
    delay(30);
  }
 
   display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
 display.print("Output:");
  display.println(sensorValue);
  display.print("RAW:");
  display.println(senseval);
  display.print("volt:");
  display.println(volt);
  display.setTextColor(BLACK, WHITE); // 'inverted' text

  display.setTextSize(4);
  display.setTextColor(WHITE);
  display.display();
  delay(1000);
  display.clearDisplay();
}

My title is using ethylene sensor to determine the fruit ripeness. The coding above involve of sensor display and its coding. Do anyone know how to present graph in labiew from arduino serial monitor? I also need to save the result as well.

0 Kudos
Message 1 of 1
(2,425 Views)