New Project and got it going :-)

Share your projects using MegunoLink Pro here!
Post Reply
rsfoto
Posts: 36
Joined: Mon Nov 20, 2017 12:09 am

Tue Dec 05, 2017 1:31 am

Hi,

After reading a bit in the Documentation section and clearing my mind from complicated thinking I managed to get a second project going.

Simple Arduino set up using a normal LED for measuring voltage according to how much light in the room.

I write the values as numbers as well as plot them in a Time plot.
IMG_2692_C1.jpg
IMG_2692_C1.jpg (240.5 KiB) Viewed 1887 times
ML_UI_and_Plot.JPG
ML_UI_and_Plot.JPG (182.1 KiB) Viewed 1887 times
and here the code

Code: Select all

#include "MegunoLink.h"

InterfacePanel LAS;
TimePlot AnalogTomVolt;

int LedSensor;
float mVolt;


void setup()

{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
}

void loop()

{

  LedSensor = analogRead(A0);
  mVolt = LedSensor * 4.8875;

  AnalogTomVolt.SendData("Analog", LedSensor);
  AnalogTomVolt.SendData("mVolt", mVolt);  

  LAS.SetNumber("A0", LedSensor);
  LAS.SetNumber("CmV", mVolt);
  
  delay(500);
}
regards Rainer

Observatorio Real de 14, SLP, MEX
Post Reply