极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9923|回复: 1

小白求助enc28J60 问题

[复制链接]
发表于 2014-3-27 15:24:59 | 显示全部楼层 |阅读模式
#include <EtherCard.h>

static byte mymac[] = {0xDD,0xDD,0xDD,0x00,0x00,0x01};
char website[] PROGMEM = "www.lucadentella.it";

byte Ethernet::buffer[700];
static uint32_t timer;

static void response_callback (byte status, word off, word len) {
  
  Serial.print((const char*) Ethernet::buffer + off + 207);
}

void setup () {

  Serial.begin(57600);
  Serial.println("Client Demo");
  Serial.println();

  if (!ether.begin(sizeof Ethernet::buffer, mymac, 10))
    Serial.println( "Failed to access Ethernet controller");
else
   Serial.println("Ethernet controller initialized");
Serial.println();

  if (!ether.dhcpSetup())
    Serial.println("Failed to get configuration from DHCP");
  else
    Serial.println("DHCP configuration done");

  ether.printIp("IP Address:\t", ether.myip);
  ether.printIp("Netmask:\t", ether.mymask);
  ether.printIp("Gateway:\t", ether.gwip);
  Serial.println();
  
  if (!ether.dnsLookup(website))
    Serial.println("DNS failed");
  else
    Serial.println("DNS resolution done");  
  ether.printIp("SRV IP:\t", ether.hisip);
  Serial.println();
}

void loop() {

  ether.packetLoop(ether.packetReceive());
  
  if (millis() > timer) {
    timer = millis() + 5000;
    ether.browseUrl(PSTR("/demo/"), "aphorisms.php", website, response_callback);
  }
}


下面是报错的信息:
_3_Client.ino: In function 'void setup()':
_3_Client:32: error: 'class EtherCard' has no member named 'mymask'




这是哪里出问题了, 求指教
回复

使用道具 举报

发表于 2014-3-28 16:52:56 | 显示全部楼层
这个例子有问题,应该是netmask, 我遇到过同样的问题
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-13 21:47 , Processed in 0.036436 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表