Sketch: programazioa
Koadro honetan ikus dezakezu liburutegia kargatu ondoren Arduino MKR Wifi 1010 plakara bidaliko dugun programa:
/* Sketch generated by the Arduino IoT Cloud Thing "p07" Arduino IoT Cloud Variables description The following variables are automatically generated and updated when changes are made to the Thing int valorsensor; Variables which are marked as READ/WRITE in the Cloud Thing will also have functions #include <WiFiNINA.h> #include "thingProperties.h" int inpin=7; // hasieratu pin 7 irakurtzeko |
void setup() { // thingProperties.h-n definitua // Konektatu Arduino IoT Cloud-era pinMode(inpin,INPUT); // ezarri botoiaren pina "sarrera" gisa /* WiFiDrv::pinMode(25, OUTPUT); //define GREEN LED WiFiDrv::digitalWrite(26, LOW); //RED |
void loop() { // probatu Arduino Cloud plataformarako konexioa if (ArduinoCloud.connected() == 0) { // sentsore kodea valorsensor=digitalRead(inpin); // irakurri 7 pinaren maila-balioa eta esleitu bal Serial.println("--------------------------------"); |