Skocz do zawartości

PlatformIO - alternatywne środowisko dla Arduino IDE


Komentator

Pomocna odpowiedź

Po zainstalowaniu i skonfigurowaniu PlatformIO,  zainstalowałem bibliotekę IRremote, w Arduino IDE kompilacja kodu przebiegła pomyślnie, a w PlatformIO zgłaszała błędy.  Dlaczego?

Edytowano przez macizet
Link do komentarza
Share on other sites

To chyba problem z wywolywaniem funkcji w ponizszym kodzie:

#include <Arduino.h>
// Included libraries:
#include <IRremote.h>
#include <IR_def.h>

// Motors pins definition:   Motor   Pin of H-Bridge
#define M1_1 10 //             1          IN1
#define M1_2 11 //             1          IN2
#define M2_1 12 //             2          IN3
#define M2_2 13 //             2          IN4

int RECV_PIN = 2; // Pin of IR TSOP receiver

// Initialize the receiver:
IRrecv irrecv(RECV_PIN);

decode_results results;
// Code:
void setup() {
  // Pins setup:
  pinMode(M1_1, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  loope();
}
void loope() 
{
  digitalWrite(M1_1, HIGH);
}

A to bledy:

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\IRremote.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\irPronto.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\irRecv.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\irSend.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Aiwa.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Denon.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Dish.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_JVC.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_LG.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Lego_PF.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Mitsubishi.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_NEC.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Panasonic.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_RC5_RC6.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Samsung.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Sanyo.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Sharp.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Sony.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Template.cpp.o
Compiling .pioenvs\uno\libc5c\IRremote_ID4\ir_Whynter.cpp.o
Archiving .pioenvs\uno\lib166\libIR_def.a
Archiving .pioenvs\uno\libc5c\libIRremote_ID4.a
Archiving .pioenvs\uno\libFrameworkArduinoVariant.a
Compiling .pioenvs\uno\FrameworkArduino\CDC.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\HardwareSerial0.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\HardwareSerial1.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\IPAddress.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\PluggableUSB.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\Print.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\Stream.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\Tone.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\USBCore.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\WInterrupts.c.o
Compiling .pioenvs\uno\FrameworkArduino\WMath.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\WString.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\abi.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\hooks.c.o
Compiling .pioenvs\uno\FrameworkArduino\main.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\new.cpp.o
Compiling .pioenvs\uno\FrameworkArduino\wiring.c.o
Compiling .pioenvs\uno\FrameworkArduino\wiring_analog.c.o
Compiling .pioenvs\uno\FrameworkArduino\wiring_digital.c.o
Compiling .pioenvs\uno\FrameworkArduino\wiring_pulse.S.o
Compiling .pioenvs\uno\FrameworkArduino\wiring_pulse.c.o
Compiling .pioenvs\uno\FrameworkArduino\wiring_shift.c.o
Archiving .pioenvs\uno\libFrameworkArduino.a
Linking .pioenvs\uno\firmware.elf
Checking size .pioenvs\uno\firmware.elf
Building .pioenvs\uno\firmware.hex
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [          ]   0.4% (used 9 bytes from 2048 bytes)
PROGRAM: [          ]   1.4% (used 444 bytes from 32256 bytes)
========================= [SUCCESS] Took 15.65 seconds =========================

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
Linking .pioenvs\uno\firmware.elf
Checking size .pioenvs\uno\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [          ]   0.4% (used 9 bytes from 2048 bytes)
PROGRAM: [          ]   1.4% (used 444 bytes from 32256 bytes)
========================== [SUCCESS] Took 3.96 seconds ==========================

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
Linking .pioenvs\uno\firmware.elf
Checking size .pioenvs\uno\firmware.elf
Building .pioenvs\uno\firmware.hex
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]  10.7% (used 219 bytes from 2048 bytes)
PROGRAM: [          ]   3.9% (used 1250 bytes from 32256 bytes)
========================== [SUCCESS] Took 4.15 seconds ==========================

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:22:9: error: 'loope' was not declared in this scope
loope();
^
*** [.pioenvs\uno\src\main.cpp.o] Error 1
=========================== [ERROR] Took 4.24 seconds ===========================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:23:9: error: 'loope' cannot be used as a function
loope();
^
src\main.cpp: In function 'void loope()':
src\main.cpp:29:12: error: 'void loope()' redeclared as different kind of symbol
void loope() {}
^
src\main.cpp:13:5: note: previous declaration 'int loope'
int loope;
^
*** [.pioenvs\uno\src\main.cpp.o] Error 1
=========================== [ERROR] Took 3.45 seconds ===========================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
src\main.cpp: In function 'void loop()':
src\main.cpp:26:11: error: 'loope' was not declared in this scope
loope();
^
*** [.pioenvs\uno\src\main.cpp.o] Error 1
=========================== [ERROR] Took 3.68 seconds ===========================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
---------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
src\main.cpp: In function 'void loop()':
src\main.cpp:26:11: error: 'i' was not declared in this scope
loope(i);
^
src\main.cpp:26:12: error: 'loope' was not declared in this scope
loope(i);
^
*** [.pioenvs\uno\src\main.cpp.o] Error 1
=========================== [ERROR] Took 3.53 seconds ===========================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
--------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
Linking .pioenvs\uno\firmware.elf
Checking size .pioenvs\uno\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]  10.7% (used 219 bytes from 2048 bytes)
PROGRAM: [          ]   3.9% (used 1250 bytes from 32256
bytes)
============= [SUCCESS] Took 4.42 seconds =============

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
--------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IRremote> 2.3.3
|-- <IR_def>
Compiling .pioenvs\uno\src\main.cpp.o
src\main.cpp: In function 'void loop()':
src\main.cpp:26:9: error: 'loope' was not declared in this scope
loope();
^
*** [.pioenvs\uno\src\main.cpp.o] Error 1
============== [ERROR] Took 3.59 seconds ==============
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

> Executing task: C:\Users\DELL\.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
--------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <IR_def>
|-- <IRremote> 2.3.3
Compiling .pioenvs\uno\src\main.cpp.o
Archiving .pioenvs\uno\libf1e\libIR_def.a
src\main.cpp: In function 'void loop()':
src\main.cpp:26:9: error: 'loope' was not declared in this scope
loope();
^
Compiling .pioenvs\uno\lib969\IRremote_ID4\IRremote.cpp.o
*** [.pioenvs\uno\src\main.cpp.o] Error 1
============== [ERROR] Took 4.75 seconds ==============
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Kilka razy probowalem skompilowac. Moze cos zle z ta funkcja?

Poza tym przepraszam za pisownie, bo mam norweska klawiature 😉

To loope to tak na probe.

No, i chyba kilka razy powielalem kompilacje, wiec sorki za dlugosc tego ERROR

Link do komentarza
Share on other sites

Zarejestruj się lub zaloguj, aby ukryć tę reklamę.
Zarejestruj się lub zaloguj, aby ukryć tę reklamę.

jlcpcb.jpg

jlcpcb.jpg

Produkcja i montaż PCB - wybierz sprawdzone PCBWay!
   • Darmowe płytki dla studentów i projektów non-profit
   • Tylko 5$ za 10 prototypów PCB w 24 godziny
   • Usługa projektowania PCB na zlecenie
   • Montaż PCB od 30$ + bezpłatna dostawa i szablony
   • Darmowe narzędzie do podglądu plików Gerber
Zobacz również » Film z fabryki PCBWay

A teraz jeszcze jeden problem: Nie dziala skrot do kompilowania Ctrl+alt+B. Jak to naprawic?

A dokladniej to wyswietla sie taki komunikat: command 'platformio-ide.build' not found

Link do komentarza
Share on other sites

Musisz wejść C:/Users/Twoja nazwa użytkownika.../.platformio/lib, i tam wkleić folder z biblioteką, potem jak uruchomisz VSC to biblioteka powinna pojawić się w zainstalowanych.

Mam nadzieję że pomogłem 😀

  • Lubię! 1
  • Pomogłeś! 1
Link do komentarza
Share on other sites

Witam nie wazne jaki mam komputer na kazdym platformio nie instaluje sie tzn nie pobiera z netu za kazdym razem jest failed a to błedy

Cytat

 

https://github.com/platformio/platformio-vscode-ide/issues/new?title=Installation Manager&body=%23 Description of problem
  Leave a comment...

  BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN
  - https://github.com/platformio/platformio-vscode-ide/issues

  %23 Configuration

  VSCode: 1.47.3
  PIO IDE: v1.10.0
  System: Windows_NT, 10.0.18362, x64

  %23 Exception
  ```
  Error: PIP Core: If you have antivirus/firewall/defender software in a system, try to disable it for a while.
     ERROR: Error [WinError 87] Parametr jest niepoprawny while executing command python setup.py egg_info
ERROR: Could not install packages due to an EnvironmentError: [WinError 87] Parametr jest niepoprawny


    at c:\Users\Admin\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\dist\index.js:1:35084
    at ChildProcess.d (c:\Users\Admin\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\dist\index.js:1:8215)
    at ChildProcess.emit (events.js:203:13)
    at ChildProcess.cp.emit (c:\Users\Admin\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
  ```
  &labels=auto

 

Problem był antywirus problem rozwiazany

  • Lubię! 1
Link do komentarza
Share on other sites

Dołącz do dyskusji, napisz odpowiedź!

Jeśli masz już konto to zaloguj się teraz, aby opublikować wiadomość jako Ty. Możesz też napisać teraz i zarejestrować się później.
Uwaga: wgrywanie zdjęć i załączników dostępne jest po zalogowaniu!

Anonim
Dołącz do dyskusji! Kliknij i zacznij pisać...

×   Wklejony jako tekst z formatowaniem.   Przywróć formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Twój link będzie automatycznie osadzony.   Wyświetlać jako link

×   Twoja poprzednia zawartość została przywrócona.   Wyczyść edytor

×   Nie możesz wkleić zdjęć bezpośrednio. Prześlij lub wstaw obrazy z adresu URL.

×
×
  • Utwórz nowe...

Ważne informacje

Ta strona używa ciasteczek (cookies), dzięki którym może działać lepiej. Więcej na ten temat znajdziesz w Polityce Prywatności.