Go Down

Topic: KSduino (Read 104 times) previous topic - next topic

Has anyone ever used KSduino?

I am trying to get this up and running. I have linked the code below, but cannot get it working

I was trying to even get my w5200 up and running today and spent all day figuring out that the w5200 was not compatible with the w5100 code. Thanks for SurferTim, I was able to download another code and get my WebServer test code working properly.

If anyone could help with KSduino, i would really appreciate it.

Thanks!
John

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/*
* KSduino Simple-01 Example Sketch
*
* simple_01.ino

* KSduino Simple-01 is KSduino-library example sketch
* This example is a part of KSduino Libray for Arduino
*
* Copyright (C) Kirill Scherba 2012 <kirill@scherba.ru>
*
* KSduino library & examples is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ksduino-server is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
* @file simple_01.ino
*
* Simple-01 is an Example for Getting Started with KSduino Library
*
*/

// Includes -------------------------------------------------------------

#include <SPI.h>
#include <EthernetUdp.h>

#include <KSduino.h>

// User definition -----------------------------------------------------

// Change this values to yours

// Your Arduinos ID & Password
unsigned int deviceID = 3436;
unsigned int devicePwd = 1025;

// Your Arduinos MAC, IP & port used in your local network
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 38 };
unsigned int port = 58833;

// Server definition -----------------------------------------------------

// Do not change this values

// KSduino Server address & port
byte serverIp[] = { 178,63,53,233 };
unsigned int serverPort = 9930;

// ----------------------------------------------------------------------------

// Create KSduino class
KSduino ksd (deviceID, devicePwd, serverIp, serverPort);

// ----------------------------------------------------------------------------

void setup()
{
// Start KSduino at the beginning of setup
  ksd.begin (mac, ip, port);   
}

void loop()
{
  static byte d_value = LOW;

  // Set value to D1 variable 
  if (d_value == LOW) d_value = HIGH; else  d_value = LOW;   
 
  // Send D1 value to KSduino server
  ksd.sendOne ("d1", d_value); 
 
  // Do delay
  delay (1000);
 
  // KSduino update should be at the end of loop
  ksd.update (); 
}

Go Up