Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mb.config(mac, ip) mb does not name type #40

Open
esfx14 opened this issue Jan 18, 2019 · 1 comment
Open

mb.config(mac, ip) mb does not name type #40

esfx14 opened this issue Jan 18, 2019 · 1 comment

Comments

@esfx14
Copy link

esfx14 commented Jan 18, 2019

Board: Adafruit ESP Feather with Ethernet FeatherWing
Upload Speed: 115200
Flash Frequency: 80 MHz

I would like to use this ModbusIP thing and tried first to do it like the example, but there is this error message, that mb does not name type.

#include <SPI.h>
#include <Arduino.h>
#include <Ethernet.h>
#include <Modbus.h>
#include <ModbusIP.h>

const int SWITCH_ISTS = 100;
ModbusIP mb();
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
byte ip[] = {0,0,0,0};
mb.config (mac,ip);

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

sketch_jan17c:12:1: error: 'mb' does not name a type
mb.config (mac,ip);
^
exit status 1
'mb' does not name a type

@ebot1234
Copy link

First take away the parenthesis from in front of the mb name for ModbusIP. Also use #include "Modbus.h" and #include "ModbusIP.h" instead of <> . Arduino doesn't like that and the error should go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants