How can I port an Arduino library to the ATTiny family of microcontrollers? I'm using avrdude if that helps.
Thanks.
There is no specific procedure. You should just try to compile the library and deal with the error messages one at a time. You should generally look at the first error message printed by the compiler and fix that before moving on to the next. The Arduino IDE defines a lot of things that are not available in a plain avr-gcc compiler (e.g. digitalWrite), so you will need to replace references to those things with something else.
If you have a more specific question about how to fix one of those error messages, feel free to post a new question on this site.
Related
I've just discovered the ATtiny84/85 chips and have ordered a few to use in some projects. I've looked high and low for all the support it has for programming through the Arduino IDE and Uno and have come across high-low tech's website and the supported arduino functions in that core.
Then I came across SpenceKonde's ATTinyCore which is another highly regarded core for the ATTiny series. The problem is that I can't find any information as to what classic Arduino functions this core supports. I mean like a list. I'm sure the basic functions are supported but how about using sleep mode / low power mode and a few other things. Is everything in the Arduino.h library supported?
Sorry if this is a silly question but a little help would be much appreciated.
I have contacted DrAzzy a.k.a Spence Konde on the Arduino Forum regarding this matter and I'm going to quote his reply to me down below.
ATTinyCore (and my other cores) implements all of the standard Arduino API functions that are logically coherent for the hardware in question. Everything should work, even the stuff that I think is a dumb idea (eg, SerialEvent, yield()) - if it doesn't, it should be reported to me as a bug. There are only a few places where I knowingly departed from the official Arduino behavior
Stuff that isn't arduino API, like the stuff that's included with avrlibc, has no dependence on the core whatsoever. If the hardware supports it, those libraries should work. If it fails to compile with the library (or a specific call in the library) in the sketch (generally giving either a #error saying it's unsupported, or an "undefined reference" to a register or bit name - actually calling it at a sensible time or uploading and verifying it behaves the way you want is usually unnecessary)
Hope this helps you guys. Thanks again to Spence Konde (DrAzzy) for the amazing ATTinyCore and his help in this matter.
I'm starting to use Visual Studio Code for my IoT work, including microprocessor coding. I've used Arduino and Teensy, my current project is using a Particle Electron.
I need a head start finding the correct add-ins and/or approach to debug an Electron. I believe my 2 unknowns are:
What VSCode extension should I use, does one exist, do I need one?
Do I require a piece of hardware, like the Particle debug shield, ST-Link J-Link, etc.?
Is there a common interface/protocol I should be looking for, to
measure VSCode compatibility for debuggers, etc.?
Any input would be appreciated.
Thanks
-John
You can find answer to your query here :
Spend some time reading its documentation.
compiling details can be found here.
I'm absolutely new to microcontroller development and currently want to:
Understand a typical process of the development
Set I/O and tune all tools for the development.
Currently I'm using Arduino Uno (ATmega328 based)
I found PlatformIO. It looks useful for me to work with microcontrollers on different platforms
Qt Creator is a favorite IDE, and I'd prefer to continue using this for AVR programming (PlatformIO can also generate Qt Creator's project template)
I've tried to build and run first sketch there, it works. So the only question is still there is a debugging.
Correct me if I'm wrong, two primary ways to do this is a JTAG and debugWire, and both ones are "hardware" debug, correct? And, of course, require additional devices.
In other hand, Qt Creator has a "bare metal" plugin which can work (debug) with a devices who can "behaves" as gdbserver.
I also found this article where the author suggests own implementation for a library for an Arduino project, which emulates gdbserver for a PC GDB client via the usual serial connection. Of course, I'll try this way as a preferable in my case.
So the question is - please confirm that all assumptions are correct.
And probably someone uses this way (maybe without this IDE).
I wanted to integrate a sensor to arduino uno. It may be any sensor, but I should design the drivers and libraries myself. I am a beginner to this stuff. Please could someone suggest me how to start this.
For example: I have a arduino uno and a accelerometer sensor(adxl345). How should I start integrate the sensor to arduino, what are the basics I should know before doing this and what details I should know before starting. And how do I start after having those details.
Please suggest me on this or guide me the location where I get these details.
To write Arduino libraries, here are two tutorials I recommend:
Writing a Library for Arduino
Classes Course on Cplusplus.com
Once you know how to write libraries and classes, you might want to go further.
I'm developing a spherical robotic smart toy for children with autism using Arduino, and I had the same issue as you: how can I write or use libraries to keep my code clean and make it reusable.
The first thing I did was to left the Arduino IDE because I think it lacks the basic function a real programmer needs such as error checking and code completion (you could argue that it checks your code while compiling, but I want real time error checking).
I also needed a way to compile my code without using the old avr-gcc provided by the Arduino IDE. That's where Sudar's Arduino-Makefile came as a blessing! I could write my code using my favorite text editor and compile it simply.
To help some friend with their project, I put up a Bare-Arduino-Project, with all the documentation you need to get up and running.
Of course it is just a framework to get you started, but you can configure everything to suit your need. It will work on OS X and Linux. It should work on Windows as well with some changes but I haven't tested it.
Hope it helps! :)
Is it possible to make Google Protocol Buffers work in Arduino?
I have been trying for about a week and can't make it work, and I would like to know if it's even possible.
This should fit on an Arduino:
https://github.com/nanopb/nanopb
I've managed, after several attempts, to compile google protocol buffers for Arduino (using lite runtime), and still, the resulting code size was way over the 32k limit. So, for now, GPB isn't a viable option for Arduino projects. (maybe on Arduino Mega?)
I suggest you look at MQTT for a suitable replacement (I'll do that).
Looking at the link provided it says it has bindings for C++. This is essentially what the arduino is programed in. I see no reason why it wouldn't work. If you were to post some details (the data object your trying to process and the C++ code the system generated) we might be able to help. What exactly isn't working?
If you are looking for a tutorial on using Protobuf on Arduino, you can check out my article: A simple Arduino IoT example with Protobuf. The code is available on Github.
The tutorial uses my library Embedded Proto. You have to copy the Embedded Proto to the Arduino library folder, and it will build. Full details in the tutorial.
If you have any questions, let me know.