Library libusb 1.0.9 on Raspberry Pi - raspberry-pi

I am having a problem with compilation of my Java file.
I want to use the libusb-1.0.9 library, but the problem is that it cannot find the symbols, like LibUsbException, LibUsb.bulkTransfer, etc. The code is written in the nano text editor, and I have no idea how to implement this library to my code.

Related

"Unresolved library: keyboard" - Visual Studio Code, Robot Framework project

I installed the keyboard library by "pip install keyboard" in the CMD/terminal, but my VSC still does not read it? It's a robot framework automation testing project
https://prnt.sc/l1o6iEMsKAOA
Your problem is that you are trying to load a python library, namely keyboard as a RobotFramework library, which is not possible and that's why you get your current error.
To fix your problem you need to create your own custom library that makes use of the keyboard python library. You can also search for existing RobotFramework libraries that allows you to do what you need. I'm not sure what you want to do, but be aware that BuiltIn, OperatingSystem, Process libraries might be able to execute keyboard commands.

How to use external modules in MicroPython on micro:bit from VSCode

I’m new to both micro:bit and MicroPython (or Python in general) - but I want to have it all running in VSCode. I grabbed this extension which was really smooth working with.
My problem now is that I want to leverage external modules, for things like the NeoPixels and also the bit:bot stuff, but I don’t know how to actually get that working. The NeoPixel tutorial is straight forward, but there is no mention on how to add the module.
I tried adding them with pip - but that won’t make them end up on the device. I’ve also tried this extension - hoping it would do some more magic in getting it onto the device.
Is this doable? Or would I have to revert do the online editors?
The micro:bit is a very constrained environment and will not run Python only MicroPYthon. MicroPython was designed to work under the constrained conditions of a microcontroller. As a result MicroPython does not come with the full Python standard library and only includes a small subset of the Python standard library.
For MicroPython to run on the micro:bit there needs to be the MicroPython hex file and any Python code that you have written, with main.py being the entry point.
The VS Code Extensions you linked to use uFlash to copy from your machine to the micro:bit the hex file and any Python files you have written.
To use the neopixel module it should be as straight forward as import neopixel as it is part of the standard BBC micro:bit MicroPython.
For BitBot, it only uses the standard micro:bit MicroPython library so I'm not sure what you are looking to import.
You can create a module by putting the code in .py file and referencing it in your main.py file. You do this by using an import statement that calls the file or specific parts of it.
MicroPython does have the concept of upip but I am not aware of that being available on micro:bit.

Linking with pe-i386 object file and a pe-x86-64 object file

Because my understanding of this problem is limited, please excuse me if I provide irrelevant details.
Question
I have two versions of MingGW on my computer, and both are 32-bit. The first one is what I call "basic MinGW", and it's the one I installed using mingw-get several years ago. The other one came with MSYS2.
Here are the constraints I am dealing with, details provided in the postscript:
My program depends on library A, which I can only compile from source using the MSYS2 MinGW.
My program depends on B.dll, a file that was provided to me. I do not have the source.
Using objdump, I discovered that B.dll has file format pe-i386
Using objdump, I discovered that programs compiled with the basic MinGW have file format pe-i386
Using objdump, I discovered that programs compiled with the MSYS2 MinGW have file format pe-x86-64
The end result is this:
My program cannot compile with the basic MinGW because library A (which must be compiled with MSYS2 MinGW) is incompatible
My program cannot compile with the MSYS2 MinGW because B.dll is incompatible
What is the difference between these two file formats? If they are both 32-bit, why can't I compile them together? Is it possible to convert B.dll to be compatible with the MSYS2 MinGW?
Details
Library A is libevent. At some point, libevent requires netioapi.h which does not appear to be present in the basic MinGW. However, MSYS2 MinGW is able to compile libevent.
B.dll is provided to me in Modelsim. It is the library you must link against fro compiling Verilog PLI programs.

eclipse - Linking together OpenCV libraries and Arduino Sketches

I am trying to incorporate OpenCV libraries in Arduino sketches using Eclipse. As a start, I separate the 2 prjects, OpenCV code and a simple Arduino sketch. They both compile and run beautifully in separate projects after linking everything OpenCV libraries and Arduino libraries, respectively. So then, I try adding OpenCV code into the Arduino sketch project to try and get them to run together. Even after the same linking as I did with the OpenCV project, there are compiling errors such as type '___' could not be resolved. The header inclusions like
#include <iostream>
#include <cv.h>
#include <highgui.h>
seem to not have errors to them. In the console I would have compilation errors until building such as /usr/include/c++/4.8/iostream:38:28: fatal error: bits/c++config.h: No such file or directory. I didn't have this error with the individual OpenCV project. So maybe the AVR C++ compiler is missing something the native c++ compiler has.
I don't get what I am doing wrong or know what I am forgetting.
Any help would be appreciated. Thanks!
It looks like you are trying to program OpenCV into the Arduino. Assuming you wnat to run this code in Arduino Uno, you are never be able to run OpenCV even though you successful compile the project. Arduino Uno has only around 2kb of RAM (think how big the image file you want to process is) and does not have enough flash memory for OpenCV code.
You have to look for another way like running separated OpenCV project on your computer and communicate with Arduino Uno through serial port or something.

Cant use Micro-Coap library for arduino

I am trying to get the micro-coap librarby (https://github.com/1248/microcoap)
to work on my arduino. When I try to compile it in the Arduino IDE, it reports that <sys/socket.h> dependency in main-posix.c can not be found.
Searches for the problem were not helpful, except for some general C++ answer that was hinting that there is no sys/socket.h on Windows. But this should not have anything to do with Arduino right?
I looked at the ethernet library for arduino and there is a socket.h but it is not in a sys directory.
Hope you can help
It seems that the main-posix.c source file is meant to be compile for a UNIX/LINUX based operating system. If you want to use Windows to compile main-posix.c, you can use projects like Cygwin. Arduino does not have <sys/socket.h> dependency needed to compile main-posix.c. Instead open microcoap.ino in the Arduino IDE and compile and flash it to the hardware.
Someone suggested simply taking the file out of the arduino path / deleting it and that worked. As Stefan posted in his answer, it is used to build the library on unix/linux and has no relevance for arduino.