Posts with «forum» label

Installing Libraries and how to write a Library for Arduino

Libraries are files written in C or C++ which provide sketches with extra functionality, for example the ability to control an LED matrix, read an encoder, connect to a sensor, display, or module, etc. They are very useful to lower the barriers for creating amazing interactive projects and use a wide range of components.  Libraries can be created by everyone and shared with the open source community!

To use an existing library in a sketch you can use the Library Manager (available from IDE version 1.6.2), open the IDE and click to the “Sketch” menu and then Include Library > Manage Libraries and follow the Guide on this page.

 

If you want contribute with a new library for an Arduino or a Genuino board, you are welcome to do so. The best way to start is to learn how to turn a sketch into a library and when you are good at it, learn how to code with basic Arduino principles in mind in order to allow beginners to get started with Arduino easily. Follow the Guidelines at this page, here’s a preview of what you’ve find:

Be kind to the end user. Assume you are writing an API for an intelligent person who has not programmed before. Come up with a clear mental model of the concept you’re working with, and the terms and functions you will use.

Use full, everyday words. Don’t be terse with your function names or variables. Use everyday terms instead of technical ones. Pick terms that correspond to popular perception of the concept at hand. Don’t assume specialized knowledge. For example, this is why we used analogWrite() rather than pwm(). Abbreviations are acceptable, though, if they’re in common use or are the primary name for something.For example, “HTML” is relatively common and “SPI” is effectively the name of that protocol (“serial-peripheral interface” is probably too long). (“Wire” was probably a mistake, as the protocol it uses is typically called “TWI” or “I2C”.)

Avoid words that have different meanings to the general public. For example, to programmers, an error is a notification that something happened. To the general public, errors are bad things.

When you are ready, you can share your new library and documentation on this dedicated area of the Forum.

Arduino Blog 26 Oct 20:29
arduino  featured  forum  genuino  ide  libraries  

Yet another cool Pong with Arduino Uno

Everyone knows Pong, the first commercially successful arcade video game machine  originally release by Atari in 1972. In those years the game helped to establish the video game industry and nowadays is often used by makers to experiment with creating game consoles with Arduino.

Roberto Melzi recently shared on the Arduino forum a new version of Pong made with Arduino Uno:

Thanks to the VGAx library done by Smaffer, based on the previous work done by Nick Gammon, I have done a little color game for an Arduino Uno working for a VGA monitor. See for details here:

The target was to use an Arduino Uno board without special shields and supporting IC.
the fundamental components are a button, a potentiometer, few resistors and DSUB15 connector.

Tale a look at the video to see it in action:

Follow the step-by-step guide on Instructables to build one yourself.

Arduino Blog 24 Sep 21:11
arduino  featured  forum  library  pong  tutorial  uno  vga  video game  

Arduino web architecture, back to the future

The last couple of months have been the most exciting of my entire career. Here at Arduino we are doing a big shift in terms of technology, user experience, and web improvements.

A new Arduino web ecosystem is arising, and the first hint of this new approach is visible in the Arduino Day website. This single-page website was the perfect fit to start experimenting with some new technologies we wanted to put in production. The Arduino Day website was a testbed for some new features of the new architecture we want to achieve.

Goals

  1. Website online and running 99.98% of the time
  2. Fast on every device
  3. Easy way to push updates online
  4. New theme with a single page app
  5. Clear division between presentation and functionalities (client/server architecture)
  6. Https whenever is possible
  7. Microservices

People

How did we achieve these results? It has been a challenge but, from November on, we started building a new Web team with a good mix of junior and more experienced developers. Putting together the team has been key, but we also needed to change some aspects of the way we work.

The team has been always under a tight schedule, at first we started fixing legacy bugs all around, many are still in progress, but we also started experimenting with new things. We started following the agile development methods, including a daily standup meeting to better coordinate our team of designers and developers, we create dedicated topic channel in our chat system to better tackle issues and follow the improvements roadmap, and we created clear todo lists organized by priority.

Technologies

  1. Go Language at the heart of our Web Applications
  2. Angular.js as the framework to create complex and nice websites
  3. PHP for widely used Application built by other communities (forum, blog, etc.)

We based most of our web applications on PHP for many reasons. It is widely used, there are many developers proficient in it, and many of the Arduino developers are familiar with it.

If you are a tech addicted like me you know there are many downsides of using PHP, or at least it was not a good fit for us for many different reasons.

We wanted to separate the frontend and the backend, we have frontend engineers and web designers that are very good at css/js, and backend engineers who knows how to design a REST API. The division of tasks allows developers to feel comfortable in their own expertise area.

We need frequent updates to our web applications and most of the apps are custom.

This ended up in having an easy way to update the system, with just a single binary and all dependencies in it. In addition we planned to have many microservices, each of them doing just one small thing, the Unix way. The language of our choice was Go.

Go is a relatively new language and allowed us to create REST API in few hours/days. It is impressively fast and soon we figured out that our bottleneck was not the language/framework neither the application, but our database (we are thinking about moving from MySQL to PostgreSQL, MongoDB or RethinkDB -very impressed by the last one-)

Having a single binary application made it extremely easy to setup a scalable architecture. Now adding a new server to our load balancer requires just a couple of minutes and it is almost completely automated.

 The frontend of Arduino Day Website is written using the Angular.js framework, allowing us to have a very interactive and responsive interface with an easy way to deploy. Everything is deployed to a nginx server (soon we will use something like Amazon S3), the files are minified and compressed so that the website is relatively fast.

I know this is not exactly cutting edge, but it is very hard to introduce something new in an environment developed for many years and used by so many users of our community. You cannot just introduce a new feature or start a project from scratch, you need to support your old code, keep it running, maintaining it and possibly avoid downtimes and maintenance windows.

Learning from mistakes

We are makers, we made mistakes. Every transition is risky and could end up is some issues. We took the risk when we migrated the forum to a new unstable version and we made a mistake, we learnt a lot from it and we are trying to similar issues as much as possible in the future.

Doing good things is hard, it requires time and the constant feedback from our amazing community. Many of you helped us already giving feedback on the arduino.cc website, the Arduino Day website, the forum and so on. We keep improving the whole web platform as fast as we can, and obviously we are always looking for the right new talent to join the Arduino team.

 

Arduino Blog 16 Apr 14:59

New forum

Hi everyone, I am trying something new. I have put a new forum page on this blog to help with project related questions. Sometimes the comments section of a project is not adequate for these queries, so I am trying out a new forum page to see if this helps or not. Let me know what you think, and if you have any suggestions, please let me know in the comments. ScottC