I can use PlatformIO with official stable ESP8266 Arduino library.
However, I'd like to use PlatformIO with the git version of this library (the latest version available). How can I achieve that?
I tried inspecting boards json files but without any luck.
platformio platform install https://github.com/platformio/platform-espressif8266.git#feature/stage
Set platform to espressif8266_stage in platformio.ini
[env:nodemcuv2]
platform = espressif8266_stage
board = nodemcuv2
framework = arduino
origin
Related
I worked through the steps at https://www.jetbrains.com/help/clion/platformio.html to get PlatformIO installed and working with CLion. The following program now works:
void setup() {
Serial.begin(9600);
Serial.println("yay, I'm working.");
}
void loop() {
}
Now... I need to get an ESP32-compatible SSD1306 library installed (among others), so I can actually do something useful.
As far as I can tell, CLion (with or without the PlatformIO plugin) has nothing like the library browser in the Arduino IDE. Is there a less barbaric way of getting Arduino libraries into a CLion-PlatformIO project than grabbing the library's repo from Github and hand-copying files (and their recursive dependencies)?
Are PlatformIO projects created via CLion round-trip compatible with VSCode+PlatformIO? Like, can I create the PlatformIO project in CLion, exit CLion, launch VSCode, open the same project, use VSCode to add the libraries, exit VSCode, then go back into CLion and use them? Or is that a recipe for pain, tears, and corrupt config files?
Opening a CLion+PlatformIO project in Visual Studio Code works fine especially when you just want to add Libraries.
As far as am concerned PlatformIO works best with Visual Studio Code.
As far as I can tell, CLion (with or without the PlatformIO plugin) has nothing like the library browser in the Arduino IDE. Is there a less barbaric way of getting Arduino libraries into a CLion-PlatformIO project than grabbing the library's repo from Github and hand-copying files (and their recursive dependencies)?
Using PlatformIO, you just need to add the library name into platformio.ini file. PlatformIO provides PlatformIO Home to help you with searching and adding library into platformio.ini file. Run pio home in the your terminal. If your setup is correct you will be able to run the command and access the web app.
For your reference:
Home page
Library Browser
Adding library to your project
platformio.ini
Are PlatformIO projects created via CLion round-trip compatible with VSCode+PlatformIO? Like, can I create the PlatformIO project in CLion, exit CLion, launch VSCode, open the same project, use VSCode to add the libraries, exit VSCode, then go back into CLion and use them? Or is that a recipe for pain, tears, and corrupt config files?
Yes. You can open it from both IDE. You can view more in their docs
I'm trying to create a Qt application that will run embedded on a Raspberry Pi 3. I followed this guide for cross-compiling and was able to run the example qopenglwidget on the Pi correctly. Now my problem is that I would like to build on my Macbook Pro in Qt Creator, but I have no idea how to now deploy to the device. All the guides I've seen online haven't explained what's actually going on and I have no idea how to build a cross compiler on my Mac. Could anyone point me in the right direction about how to do this?
So you have already compiled an example on your mac that runs on your raspberry pi?
This means you already have a cross compiler.
The guide you linked got a prebuild toolchain from https://github.com/raspberrypi/tools
But I think those are only for ubuntu.
When building Qt you need to specify the toolchain in the configure line:
-device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
This is the path to the cross compiler you compile Qt with.
Did this work for you or did you modify this line?
If you want to build a cross compiler yourself you can follow this guide, although I wasn't able to compile Qt with this compiler.
If you have compiled Qt and the examples work on your Pi, you can add a new kit in Qt Creator on your Mac:
Open Qt-Creator -> Preferences:
Under Devices, add a new Generic Linux Device and follow the assistant
Add a new kit, choose a Generic Linux Device as well and specify the device you just added, your compiler you used to build Qt, the debugger if you have built one with you compiler and the Qt Version you compiled.
You should be able to build your project with this kit and it will deploy to your device
Tell us if you were successful.
I'm wondering how to use Arudino libraries for projects using regular microprocessors, in my case, the ATMega328p. I just have a PDIP processor on a breadboard and I'm not using an Arudino Uno or anything. I also don't want to be use the setup() and loop() Arduino programming environment, but I do want to be able to download and use the EtherCard library, which includes Arduino.h within it.
I'm using Atmel Studio 6.2 on Windows 8.1. I've found this post Using the Arduino libraries for regular AVR code which includes an excellent response, but it's specific (i think) to the linux environment. Has anyone used Arudino libraries for a non-arduino project? If so, how do I properly include them in Atmel Studio?
Thanks in advance for any input you may have.
There are two sets of libraries in Arduino tree. The first general AVR libraries (C) and the second Arduino libs (C++). Arduino extends AVR libraries providing some implicit functionality clock (msec, sec), streams, UART buffered handler etc. Obscure .ino extension file is copied to .cpp with added #include "Arduino.h" line. From my point of view Arduino IDE is wrong idea because it does not use normal make file but it's somehow hardcoded it in java (using only external avr-gcc).
Also "to-be-implemented" loop(), setup() seems like obscure idea introduced by Arduino's main.cpp implicitly linked in every project.
But I'm using both AVR and Arduino libraries and compile with avr-gcc (installed in Arduino tree). I recommend more fresh gcc (4.7 or so unless it causes problem in Avrstudio as Avrstudio 4.19 toolchain using gcc 4.7.x). I have own Makefile and using in Windows XP. You can override also some Arduino functions implemented using attribute ((weak)).
Please connect the ATMEGA USBASP programmer and the ATMEGA328 controller like shown below:
(source: learningaboutelectronics.com)
Then write the ATMEGA Uno firmware code to the controller. It is available over here - https://github.com/arduino/Arduino/tree/master/hardware/arduino/bootloaders/optiboot
Download the 328 hex version over there. These boot loaders will also be available in you computer if you have successfully installed Arduino Sketch IDE. Now write the hex code to the micro-controller using he programmer and from then onwards the controller will work as a arduino uno. Connect the basic crystal and use a breadboard circuit as shown below.
Now you continue your programming and loading on arduino sketch.
I try to open and compile arduPilot code using Arduino IDE (V. 1.0.5). But it's not working. I found the code is not compatible with standard IDE.
How can you modify the code and build it? any help is appreciated.
It just worked for me. ArduPilot 2.7.1 and Arduino 1.0.5 on Windows.
Note that the ArduPilot build was last updated in 2010, back when Arduino was not using the new INO files, but PDE files. So you have to manually go to file->open, then select ardupilot_2-7.pde to open.
As you can see above ArduPilot has a modified Arduino IDE. The Visual Micro plugin for Atmel Studio also supports the APM modifications.
I've attempted this myself by compiling the Arduino libraries into their own standalone library and linking to a project in Eclipse, but have had a couple of issues along the way.
Is there a decent guide on how to get this up and running? I've been hard pressed to find one online that actually works... The arduino.cc guide has a couple of flaws in, and troubleshooting drove me insane.
I'm on Mac OS X 10.5 with an Uno board.
Edit: Might be worth noting that most Arduino C guides don't specify the baud rate necessary, just the MCLK frequency (16 MHz). Make sure you've changed this or AVRDude won't understand how to flash your IC.
Other people have had some success using the guide Using Eclipse with Arduino Duemilanove.
Arduino will not work in pure C setup as it requires a C++ compiler. However if you want to include arduino core and other libraries inside your project then read on. Here we can see how to use Arduino Ethernet Library with our code.
STEP BY STEP GUIDE
Get Arduino cores and variants/ files.
Get relevant library, e.g. Arduino Ethernet library
The directory structure is
/
lib/arduino/cores
lib/arduino/variants//pins_arduino.h
lib/arduino/makefile
lib/arduino/build
lib/
The sample make file can be downloaded from:
https://gist.github.com/rjha/b7cda6312552c3e15486
First create Arduino core as a static library. To do so:
$cd to lib/arduino folder
$ make clean
$ make lib
This will create lib/arduino/build/libarduino.a static library file.
Next we goto main project Makefile. There we can define any Arduino library,e.g. Arduino SPI or Arduino Ethernet as a make target that compiles against Arduino core library.
Inside our own make target, we can include Arduino Target that in turns include Arduino core.
For (7) and (8) example, see this gist
https://gist.github.com/rjha/e7b123d3dc4346b5830c
(9) when creating Hex and general linking, link using -larduino and keep the libarduino.a in the search PATH. #see above Gist for an example.
(10) Using this structure you can use any Arduino libraries inside your own code.
Most of the Arduino libraries are a mess dependencies wise and the code quality is also poor. The only benefit is that you can get some ready made libraries to link against your code.