please anyone help me I need convert this code to matlab 🥺
Afficher commentaires plus anciens
#define SSID "jetusedtoiw" #define PASSWORD "12345678" #define LINE_TOKEN "qrQFE2XheIbfKk4IVSnpD9aL6noBZQGaj0diw4H0ufJ" String message = "ฝนตกแล้วน้า ระวังเป็นหวัดนะ!"; void setup() { Serial.begin(9600); Serial.println(LINE.getVersion());
WiFi.begin(SSID, PASSWORD);
Serial.printf("WiFi connecting to %s\n", SSID);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(400);
}
Serial.printf("\nWiFi connected\nIP : ");
Serial.println(WiFi.localIP());
LINE.setToken(LINE_TOKEN);
}
void loop() { val = analogRead(analogPin); Serial.print("val = "); Serial.println(val); if (val < 500 and x == 0) { LINE.notify(message); delay(1000); } if (val < 500) { x = 1; } else { x = 0; } delay(1000);
Réponse acceptée
Plus de réponses (1)
MathWorks MATLAB Hardware Team
le 6 Nov 2023
0 votes
Hi,
Thanks for reaching out to us. You can use MATLAB Support Package for Arduino Hardware to try this workflow.
Here are the steps,
- Install Arduino Support Package, refer to this link to know more https://in.mathworks.com/help/supportpkg/arduinoio/ug/intro.html
- Configure Arduino over WiFi by following steps mentioned in this link, https://in.mathworks.com/help/supportpkg/arduinoio/ug/configure-setup-for-arduino-hardware.html#bvn8wpb-1
- Use readVoltage API to read analog input voltage from an analog pin, https://in.mathworks.com/help/supportpkg/arduinoio/ref/readvoltage.html
- Follow custom library workflow for TridentTD_Linenotify, https://in.mathworks.com/help/supportpkg/arduinoio/custom-arduino-libraries.html
Please feel free to contact our Technical Support Team if you run into any issues,
https://www.mathworks.com/support/contact_us.html
Thanks,
MATLAB Hardware Team
MathWorks
Catégories
En savoir plus sur MATLAB Support Package for Arduino Hardware dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!