How to send data to webpage

Hi, I have an Arduino Yun and I want to send data received from a sensor on a webpage from SD card. I made a webpage but I can't find how to send the data, can anyone help? Thanks in advance!

There should be example sketches in the examples folder once the board is installed in the IDE.

I looked up every example but didn't find anything that sends the data from arduino to webpage from sd card. I tried finding tutorials but nothing worked, maybe i did something wrong. I put the html file in /sd/mysketch/file but also in /sd/arduino/www/file. I see the page but i can't send data to it.

Well, that seems to be the programmers job, not something you would just look up. You can surely find examples of sending the data and reading an SD card, separately, and then write code to put the two functions together.

Please post whatever code attempt you made, in code tags please.

I used this as reference and wanted to make the button send something to server once it's pressed, just to test that it's working.

#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h> 
#define button 4
YunServer server;
void setup() {
  Bridge.begin(); 
  server.listenOnLocalhost();
  server.begin(); 
  pinMode(button, INPUT);
}
void loop() {
  YunClient client = server.accept();
  int sensor = digitalRead(button);
  if (client) {
    if(sensor==HIGH)
    {
      client.print("test"+ String(millis()));
    }
    client.stop();
  }
  delay(500);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.