-Here are the final images for milling. As mentioned before detailed steps are mentioned in previous documentation.
I used MDX-40A machine along with Fab Modules​ to control it
Here are the Milling settings:
Machine: MDX-40
Speed: 4
Send Command: mod_lp.py/dev/usb/lp0
Server: Localhost:12345 In my case Local host was 127.0.0.1
Cut depth: 0
Tool diameter: 0.2mm
Number of offsets: 4
Offsets Overlap: 55
I decided to use 2 sensors as input devices LM35 temperature sensor and Ultrasonic Ranging Module.
-I connected the 2 sensors to my board based on the info I got from their datasheet and the datasheet of the microcontroller. I used digital pins for the sonar ranging module and an analogue one for the LM35. I read the 2 sensors in the same sketch
#include <NewPing.h>
#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define MAX_DISTANCE 200
#define Led 13
#define Temp 0
int distance=0;
int values[10];
int i,k=0;
float average,temp=0;
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
void setup() {
Serial.begin(115200);
pinMode(13, OUTPUT);
}
void loop() {
delay(50);
Serial.print("Ping: ");
distance=sonar.ping_cm();
Serial.print(distance);
values[i]=distance;
i++;
Serial.println(" cm");
if(distance>=10) {
temp=(analogRead(Temp)*0.05);
digitalWrite(13, HIGH);
Serial.print("Temp: ");
Serial.println(temp);
}
delay(500);
if(i==10) {
for(k=0;k<10;k++){average=average+values[k];}
Serial.print("Average: ");
Serial.println(average/10);
i=0;
}
digitalWrite(13, LOW);
}