Page 1 of 1

New Project and got it going :-)

Posted: Tue Dec 05, 2017 1:31 am
by rsfoto

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 (240.5 KiB) Viewed 38150 times
ML_UI_and_Plot.JPG (182.1 KiB) Viewed 38150 times
and here the code

Code: Select all

#include "MegunoLink.h"

InterfacePanel LAS;
TimePlot AnalogTomVolt;

int LedSensor;
float mVolt;

void setup()

  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);