Is it possible to convert Arduino IDE Code (C++ Code) to MATLAB Code by any means? Or does it have to be done manually?
I’m trying to translate a C++ Code which is used for Soil Moisture Sensor and Raindrop Sensor to a MATLAB Code. I was hoping to convert the C++ Code to a MATLAB Code through faster means since I have no knowledge in C++ Coding. Following is the code.
const int capteur_D = 4;
const int capteur_A = A0;
int val_analogique;
int soilMoistureValue = 0;
int soilmoisturepercent=0;
void setup() {
pinMode(capteur_D, INPUT);
pinMode(capteur_A, INPUT);
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop() {
soilMoistureValue = analogRead(A0); //put Sensor insert into soil
Serial.println(soilMoistureValue);
delay(250);
if(digitalRead(capteur_D) == LOW)
{
Serial.println("Digital value : wet");
delay(10);
}
else
{
Serial.println("Digital value : dry");
delay(10);
}
val_analogique=analogRead(capteur_A);
Serial.print("Analog value : ");
Serial.println(val_analogique);
Serial.println("");
delay(1000);
}I’m trying to translate a C++ Code which is used for Soil Moisture Sensor and Raindrop Sensor to a MATLAB Code. I was hoping to convert the C++ Code to a MATLAB Code through faster means since I have no knowledge in C++ Coding. Following is the code.
const int capteur_D = 4;
const int capteur_A = A0;
int val_analogique;
int soilMoistureValue = 0;
int soilmoisturepercent=0;
void setup() {
pinMode(capteur_D, INPUT);
pinMode(capteur_A, INPUT);
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop() {
soilMoistureValue = analogRead(A0); //put Sensor insert into soil
Serial.println(soilMoistureValue);
delay(250);
if(digitalRead(capteur_D) == LOW)
{
Serial.println("Digital value : wet");
delay(10);
}
else
{
Serial.println("Digital value : dry");
delay(10);
}
val_analogique=analogRead(capteur_A);
Serial.print("Analog value : ");
Serial.println(val_analogique);
Serial.println("");
delay(1000);
} I’m trying to translate a C++ Code which is used for Soil Moisture Sensor and Raindrop Sensor to a MATLAB Code. I was hoping to convert the C++ Code to a MATLAB Code through faster means since I have no knowledge in C++ Coding. Following is the code.
const int capteur_D = 4;
const int capteur_A = A0;
int val_analogique;
int soilMoistureValue = 0;
int soilmoisturepercent=0;
void setup() {
pinMode(capteur_D, INPUT);
pinMode(capteur_A, INPUT);
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop() {
soilMoistureValue = analogRead(A0); //put Sensor insert into soil
Serial.println(soilMoistureValue);
delay(250);
if(digitalRead(capteur_D) == LOW)
{
Serial.println("Digital value : wet");
delay(10);
}
else
{
Serial.println("Digital value : dry");
delay(10);
}
val_analogique=analogRead(capteur_A);
Serial.print("Analog value : ");
Serial.println(val_analogique);
Serial.println("");
delay(1000);
} c++, c++ to matlab MATLAB Answers — New Questions