Ucglib - fout bij compileren

Arduino specifieke Software
Berichten: 2
Geregistreerd: 13 Feb 2017, 20:09

Ucglib - fout bij compileren

Berichtdoor Jan Meer » 13 Feb 2017, 22:16

Hallo,

Ik ben bezig met een project waarin een ILI 9341 TFT display gebruikt wordt.
In de bijbehorende sketch staat voor dit display de #include "Ucglib.h" , deze heb ik gedowload van Github.
Bij het compileren van de sketch krijg ik de foutmelding:

ino:21:20: fatal error: Ucglib.h: No such file or directory
compilation terminated.
Fout bij compileren.

In de IDE zijn wel de voorbeelden terug te vinden die bij deze library horen, maar ook deze willen niet compileren.
Bijvoorbeeld deze (Hello World):

Code: Alles selecteren
 [code]
/*

  HelloWorld.ino
 
  A very simple example for Ucglib

  Universal uC Color Graphics Library
 
  Copyright (c) 2014, olikraus@gmail.com
  All rights reserved.

  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list
    of conditions and the following disclaimer.
   
  * Redistributions in binary form must reproduce the above copyright notice, this
    list of conditions and the following disclaimer in the documentation and/or other
    materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 

  18 Feb 2014:
    ROM Size   Font Mode
    9928      NONE
    10942      TRANSPARENT   (1014 Bytes)
    11650      SOLID  (1712 Bytes)
    12214      TRANSPARENT+SOLID
 
 
*/

#include <SPI.h>
#include "Ucglib.h"

   
/*
  Hardware SPI Pins:
    Arduino Uno      sclk=13, data=11
    Arduino Due      sclk=76, data=75
    Arduino Mega   sclk=52, data=51
   
  >>> Please uncomment (and update) one of the following constructors. <<< 
*/
//Ucglib8BitPortD ucg(ucg_dev_ili9325_18x240x320_itdb02, ucg_ext_ili9325_18, /* wr= */ 18 , /* cd= */ 19 , /* cs= */ 17, /* reset= */ 16 );
//Ucglib8Bit ucg(ucg_dev_ili9325_18x240x320_itdb02, ucg_ext_ili9325_18, 0, 1, 2, 3, 4, 5, 6, 7, /* wr= */ 18 , /* cd= */ 19 , /* cs= */ 17, /* reset= */ 16 );

//Ucglib4WireSWSPI ucg(ucg_dev_ili9325_18x240x320_itdb02, ucg_ext_ili9325_18, /*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);   // not working
//Ucglib4WireSWSPI ucg(ucg_dev_ili9325_spi_18x240x320, ucg_ext_ili9325_spi_18, /*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);   // not working
//Ucglib3WireILI9325SWSPI ucg(ucg_dev_ili9325_spi_18x240x320, ucg_ext_ili9325_spi_18, /*sclk=*/ 13, /*data=*/ 11, /*cs=*/ 10, /*reset=*/ 8);   // not working
//Ucglib3WireILI9325SWSPI ucg(ucg_dev_ili9325_18x240x320_itdb02, ucg_ext_ili9325_18, /*sclk=*/ 13, /*data=*/ 11, /*cs=*/ 10, /*reset=*/ 8);   // not working

//Ucglib_ST7735_18x128x160_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_ST7735_18x128x160_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);

//Ucglib_ILI9163_18x128x128_SWSPI ucg(/*sclk=*/ 7, /*data=*/ 6, /*cd=*/ 5 , /*cs=*/ 3, /*reset=*/ 4);
//Ucglib_ILI9163_18x128x128_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);   /* HW SPI Adapter */

//Ucglib_ILI9341_18x240x320_SWSPI ucg(/*sclk=*/ 7, /*data=*/ 6, /*cd=*/ 5 , /*cs=*/ 3, /*reset=*/ 4);
//Ucglib_ILI9341_18x240x320_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_ILI9341_18x240x320_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_ILI9341_18x240x320_SWSPI ucg(/*sclk=*/ 4, /*data=*/ 3, /*cd=*/ 6 , /*cs=*/ 7, /*reset=*/ 5);   /* Elec Freaks Shield */

//Ucglib_SSD1351_18x128x128_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_SSD1351_18x128x128_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_SSD1351_18x128x128_FT_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_SSD1351_18x128x128_FT_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);

//Ucglib_PCF8833_16x132x132_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cs=*/ 9, /*reset=*/ 8);   /* linksprite board */
//Ucglib_PCF8833_16x132x132_HWSPI ucg(/*cs=*/ 9, /*reset=*/ 8);   /* linksprite board */

//Ucglib_LD50T6160_18x160x128_6Bit ucg( /*d0 =*/ d0, /*d1 =*/ d1, /*d2 =*/ d2, /*d3 =*/ d3, /*d4 =*/ d4, /*d5 =*/ d5, /*wr=*/ wr, /*cd=*/ cd, /*cs=*/ cs, /*reset=*/ reset);
//Ucglib_LD50T6160_18x160x128_6Bit ucg( /*d0 =*/ 16, /*d1 =*/ 17, /*d2 =*/ 18, /*d3 =*/ 19, /*d4 =*/ 20, /*d5 =*/ 21, /*wr=*/ 14, /*cd=*/ 15); /* Samsung 160x128 OLED with 6Bit minimal interface with Due */
//Ucglib_LD50T6160_18x160x128_6Bit ucg( /*d0 =*/ 5, /*d1 =*/ 4, /*d2 =*/ 3, /*d3 =*/ 2, /*d4 =*/ 1, /*d5 =*/ 0, /*wr=*/ 7, /*cd=*/ 6); /* Samsung 160x128 OLED with 6Bit minimal interface with Uno */

//Ucglib_SSD1331_18x96x64_UNIVISION_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_SSD1331_18x96x64_UNIVISION_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);

//Ucglib_SEPS225_16x128x128_UNIVISION_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);
//Ucglib_SEPS225_16x128x128_UNIVISION_HWSPI ucg(/*cd=*/ 9 , /*cs=*/ 10, /*reset=*/ 8);

void setup(void)
{
  delay(1000);
  ucg.begin(UCG_FONT_MODE_TRANSPARENT);
  //ucg.begin(UCG_FONT_MODE_SOLID);
  ucg.clearScreen();
}

void loop(void)
{
  //ucg.setRotate90();
  ucg.setFont(ucg_font_ncenR12_tr);
  ucg.setColor(255, 255, 255);
  //ucg.setColor(0, 255, 0);
  ucg.setColor(1, 255, 0,0);
 
  ucg.setPrintPos(0,25);
  ucg.print("Hello World!");


  delay(500); 
}
[/code] 


Als ik deze in de IDE verifieer dan krijg ik als foutmelding:

Build-opties gewijzigd, alles wordt opnieuw gebuild
HelloWorld.ino:47:20: fatal error: Ucglib.h: No such file or directory
compilation terminated.
Fout bij compileren.

Ik heb 3 verschillende IDE versies onder Linux geprobeerd en één onder Windows, maar het wil niet lukken om die Ucglib werkend te krijgen.

Heeft iemand een idee wat er mis gaat?

Advertisement

Gebruikers-avatar
Berichten: 2655
Geregistreerd: 06 Aug 2016, 01:03

Re: Ucglib - fout bij compileren

Berichtdoor Koepel » 14 Feb 2017, 02:44

Heb je al eerder een sketch naar een Arduino board geupload ?
Heb je misschien de libraries van de Arduino systeembestanden gewijzigd ?
Gebruikt je Arduino IDE 1.8.1 ?
Welk Arduino board heb je ?

Ga in het menu naar: Bestand / Voorkeuren, en kijk waar je Sketchbooklocatie is.
Open die map van de Sketchbooklocatie, en ga naar de map "libraries".
Sluit Arduino IDE af.
Verwijder in die "libraries" map alles wat er niet thuis hoort, en alles van Ucglib.
Start Ardiuno IDE op.
Ga in het menu naar: Sketch / Bibliotheek gebruiken / Bibliotheek beheren.
Type in het zoekveld: ucg
Installeer de Ucglib by Oliver.
Dan terug naar je sketch. Het is nodig om het commentaar van een regel weg te halen. Kies de regel die bij je display hoort en bij de manier waarop het aangesloten is.
Daarna compileert het gewoon.

Als het niet goed compileert, dan heb je misschien een oude versie van de Arduino IDE en een nieuwe versie van de Arduino IDE door elkaar, of er zitten nog oude stukken Java in de weg. In linux kun je beter niet een gedownloade versie samen gebruiken met delen uit de repositories. Ik heb in linux meerdere versies naast elkaar die ik heb uitgepakt in hun eigen map. Van de repositories heb ik een minimale Java omgeving geïnstalleerd, maar geen Arduino dingen.

Berichten: 2
Geregistreerd: 13 Feb 2017, 20:09

Re: Ucglib - fout bij compileren

Berichtdoor Jan Meer » 21 Feb 2017, 20:33

Koepel, bedankt voor je uitgebreide reactie.
Je opmerking:

Ga in het menu naar: Sketch / Bibliotheek gebruiken / Bibliotheek beheren.
Type in het zoekveld: ucg
Installeer de Ucglib by Oliver.


bracht de oplossing van het probleem.

Het ging bij mij fout bij het plaatsen van Ucglib in de bibliotheek.
Ik had de Ucglib gedownload, uitgepakt en vervolgens in de libraries-map geplakt.
Bij eerdere Arduino-projecten werkte dit altijd wel, maar in dit geval dus niet.
Ik gebruikte de Arduino IDE 1.6.0 (en oudere versies), en daarin zit niet de mogelijkheid om libraries toe te voegen vanuit een bibliotheekbeheer.
Inmiddels heb ik 1.6.5 geinstalleerd (onder Linux) en Ucglib via bibliotheekbeheer toegevoegd.
Zowel de voorbeelden als het project waarbij deze library benodigd is, compileren nu probleemloos.

Nogmaals bedankt !

Terug naar Arduino software

Wie is er online?

Gebruikers in dit forum: Geen geregistreerde gebruikers en 28 gasten