Zum Inhalt springen

drsascha

Mitglieder
  • Gesamte Inhalte

    1
  • Benutzer seit

  • Letzter Besuch

  1. Hallo liebe Forenmitglieder, ich hänge leider gerade an einer, wohl einfachen, Aufgabe. Ich habe bei mir zu Hause einen Arduino, samt Ethernet-Shield. Das Ethernet-Shield gibt analoge Daten auf einer simplen HTML Seite aus. <!DOCTYPE HTML> <html> <meta http-equiv="refresh" content="5"> analog input 0 is 315<br /> </html> [/PHP] Nun ist es aber so, das ich nur die Zahl weiter benutzen möchte und anhand derer eine Ausgabe produzieren möchte. Ist die Zahl über 512 "ok" und unter 512 "warnung". So sieht derzeit mein Code aus. [PHP] #!/usr/bin/perl my $url = '192.168.178.26'; # Holt Informationen von Website use LWP::Simple; my $content = get $url; die "Couldn't get $url" unless defined $content; print $content Inhalt durchsuchen if($content =~ 'analog input 0 is([0-9]+)') { print "Arduino laeuft."; } else { print "Fresh Air is apparently jazzless today.\n"; } Vielen Dank schonmal

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...