Post a new topicPost a reply Page 1 of 1   [ 5 posts ]
Author Message
 Post subject: Re: MySignals Hardware shield with Arduino not working
PostPosted: Mon Oct 23, 2017 3:01 pm 

Joined: Fri Oct 20, 2017 4:51 pm
Posts: 10
I am currently having error message running the code on MySignals hardware shield with Arduino.
Basically for example the Temperature sensor code would compile and run fine on the Arduino IDE but the Sensor_Temperature_TFT would give error such as: " Error compiling for board Arduino/Genuino Uno."

Urgent help required!

Betty


Top
 Profile  
 
 Post subject: Re: MySignals Hardware shield with Arduino not working
PostPosted: Tue Oct 24, 2017 7:17 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11338
Hello boa,

what version of arduino IDE are you using? are you using the last version of our libraries? Please copy the code below and try again, We just checked that it compiles correctly in several versions of the IDE (16.11 and 1.8.5 in Linux Ubuntu):

Code:
/*

    Copyright (C) 2017 Libelium Comunicaciones Distribuidas S.L.
   http://www.libelium.com

    By using it you accept the MySignals Terms and Conditions.
    You can find them at: http://libelium.com/legal

    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.

    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.1
    Design:            David Gascon
    Implementation:    Luis Martin / Victor Boria
*/

#include <Adafruit_GFX_AS.h>
#include <Adafruit_ILI9341_AS.h>
#include <MySignals.h>

#define graphic_low_extrem 230
#define graphic_high_extrem 30
#define graphic_left_extrem 0
#define graphic_right_extrem 320


Adafruit_ILI9341_AS tft = Adafruit_ILI9341_AS(TFT_CS, TFT_DC);


//! It stores the current value of x position in the LCD.
uint16_t graphic_x;
//! It stores the current value of the MySignals.
uint16_t valRead;
//! It stores the previous value of the MySignals.
uint16_t graphic_prevRead;


void setup(void)
{
  Serial.begin(115200);
 
  MySignals.begin();
   
  tft.init();
  tft.setRotation(3);
 
  tft.fillScreen(ILI9341_WHITE);
  tft.fillRect(0,0,320,30,ILI9341_RED);
  tft.setTextColor(ILI9341_WHITE);
  tft.drawString("Temperature",5,5,4);
}

void loop()
{

  valRead = (float)MySignals.getTemperature()*10.0;
   
  Serial.println(valRead);
 
  valRead = map(valRead, 300, 400, 230, 30);
 
  printGraphic(valRead, 0);
 
}



void printGraphic(uint16_t value, uint8_t delay_time)
{

  if (value < graphic_high_extrem)
  {
    value = graphic_high_extrem;
  }
  if (value > graphic_low_extrem)
  {
    value = graphic_low_extrem;
  }


  //Pinta la linea solo a partir de que ya exista al menos 1 valor
  if (graphic_x > graphic_left_extrem + 1)
  {
    tft.drawLine(graphic_x - 1, graphic_prevRead, graphic_x, value, ILI9341_RED);
  }

  //Wave refresh (barre pantalla pintando una linea)
  tft.drawLine(graphic_x + 1, graphic_high_extrem, graphic_x + 1, graphic_low_extrem, ILI9341_WHITE);


  graphic_prevRead = value;
  graphic_x++;

  delay(delay_time);

  if (graphic_x == graphic_right_extrem)
  {
    graphic_x = graphic_left_extrem;
  }
  SPI.end();
}


Regards


Top
 Profile  
 
 Post subject: Re: MySignals Hardware shield with Arduino not working
PostPosted: Tue Oct 24, 2017 9:34 am 

Joined: Fri Oct 20, 2017 4:51 pm
Posts: 10
Hi Thank you for the reply. Am using the latest version of Arduino Uno, which your company bought for me so it came with the Sensor hardware package
What I need help with urgently is how to install the Libraries on my Mac correctly.
The Temperature code is just one of 8 different sensors am working on and they all need to work to build my application successfully.
Could you please come online today and help me with the current version of the libraries and help me with installing it correctly. I need this done today as am running out of time with my project.


Top
 Profile  
 
 Post subject: Re: MySignals Hardware shield with Arduino not working
PostPosted: Tue Oct 24, 2017 12:18 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11338
Hello boa,

in order to setup the libraries please follow these steps:
1. If you have MySignals HW V2 download the libraries from the tutorial:
http://www.cooking-hacks.com/media/cooking/images/documentation/mysignals_hardware/MySignals_HW_SDK_V2.0.2.zip

2.Locate your sketchbook. In order to know where it is, open Arduino IDE -> File -> Preferences -> Sketchbook location.

3.Copy "libraries" and "examples" folders inside your sketchbook folder in this way:
"/Users/<USER>/Documents/Arduino/libraries/Adafruit_GFX_AS"
"/Users/<USER>/Documents/Arduino/libraries/Adafruit_ILI9341_AS"
....

"/Users/<USER>/Documents/Arduino/examples/Basics/basic_adc"
.....

4.Close Arduino IDE and open it again.

Regards


Top
 Profile  
 
 Post subject: Re: MySignals Hardware shield with Arduino not working
PostPosted: Tue Oct 24, 2017 4:44 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11338
Hello again boa,

we just completed the whole process in a macOS Sierra 10.12.4 with Arduino IDE 1.8.5. and the compilation is done correctly.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 5 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:


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.