Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: BUG: include library name
PostPosted: Fri May 26, 2017 11:36 pm 

Joined: Fri May 26, 2017 11:28 pm
Posts: 1
Hello folks,

the code found on cooking hacks website for arduino
https://www.cooking-hacks.com/documentation/tutorials/rs-485-module-shield-tutorial-for-arduino-raspberry-pi-intel-galileo/

Code:
/* 
 *  RS-485 Module
 * 
 *  Copyright (C) Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 * 
 *  This program 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.
 *  a
 *  This program 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/.
 * 
 *  Version:          0.2
 *  Design:           David Gascon
 *  Implementation:   Ahmad Saad, Rubén Martín
 */

#include <Wire.h>

// Cooking API libraries
#include <arduinoUtils.h>

// Include always this library when you are using the RS-485 functions
#include <RS485.h>
//Include the SPI library
#include <SPI.h>
// Create an instance
RS485 myDevice = RS485();


void setup() {

  // Using the SOCKET0
  Utils.setONSocket0();
  Utils.setMUXSocket0();

  // Power on the USB for viewing data in the serial monitor
  Serial.begin(115200);
  delay(100);

  // Initializes the module and assigns the SPI
  if ( myDevice.begin() == 0) {
    Serial.println("RS-485 module started successfully");
  } else {
    Serial.println("RS-485 did not initialize correctly");
  }
  delay(100);

  // Configure the baud rate of the module
  myDevice.baudRateConfig(9600);
  // Configure the parity bit as disabled
  myDevice.parityBit(DISABLE);
  // Use one stop bit configuration
  myDevice.stopBitConfig(1);
  // Print hello message
  Serial.println("Hello this is RS-485 communication send data example.");
}



void loop() {
  // Reading the analog input 1
  int analog1 = analogRead(A1);
  //Reading the analog input 2
  int analog2 = analogRead(A2);

  // Send data through RS-485 line
  myDevice.send("Data from analog1 input : ");
  myDevice.send(analog1);
  myDevice.send("\n");

  myDevice.send("Data from analog2 input : ");
  myDevice.send(analog2);
  myDevice.send("\n");

  delay(1000);
}




the library provided by cooking hacks includes <RS485.h> but the library file privided the different name that is include <arduinoRS485.h>.

Please correct it.

Thank you..! :geek:


Top
 Profile  
 
 Post subject: Re: BUG: include library name
PostPosted: Mon May 29, 2017 8:16 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello Will_Kill,
Thanks by your correction, we will update the example ASAP.
We always recommend to use the examples provided with the library.
Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.