Hey guys,
I’m new to MF Gadgeteer, and I’m having trouble with conectivity using the Ethernet J11D module provided on the GHI Electronics kit.
Basically, I need a code that catch a number on a website (www.arvoredaenergia.com.br/pinos.php) , and the number will be the variable who will set the configuration of some pins.
The control of the pins itself I did successfully, but I`m having trouble with going to the internet and getting this number.
I just need to know where and what to put in the code to set internet, go through a website, and receive this number.
This is how my code looks like:
using System;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Net.NetworkInformation;
using System.IO;
using System.Text;
using Microsoft.SPOT.Net.Security;
using System.Security.Cryptography.X509Certificates;
//using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GTNet = Gadgeteer.Networking;
namespace Testpin
{
public partial class Program
{
GT.Interfaces.DigitalOutput ledControl3;
GT.Interfaces.DigitalOutput ledControl4;
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
GT.Socket socket = GT.Socket.GetSocket(11, true, null, null);
ledControl3 = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Three, false, null);
ledControl4 = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Four, false, null);
int pino = 9;
//caso 0 : Nothing happens
if (pino == 0)
{
}
//case 1 : 1 pin set
if (pino == 1)
{
//set pin 3
ledControl3.Write(true);
}
//case 2 : 2 pin set
if (pino == 2)
{
//set pin 3 and 4
ledControl3.Write(true);
Thread.Sleep(3000); //pause
//acende pino4
ledControl4.Write(true);
}