Posts with «ide» label
Sublime Text as an Arduino IDE
If you’ve played with an Arduino, you’ve probably been frustrated by the IDE. It works, but it’s not the best editor. It’s especially painful for bigger files and larger projects. The Stino plugin for Sublime Text aims to solve this issue by bringing the full functionality of the Arduino IDE to the Sublime Text editor.
Sublime Text is a powerful text editor with support for most programming languages. What it’s missing is support for compiling and uploading code to an Arduino. Stino bridges that gap. Sublime is a commercial product, and retails for $70 USD. However Sublime does have an indefinite trial period, so Stino can be evaluated for free. Stino itself is an open source plugin written in Python, and you can contribute to the project on Github.
After installing Sublime and Stino, you point the plugin at an Arduino install folder. It then allows you to build and flash directly from the editor. For anyone who’s been frustrated with the Arduino IDE, this looks like a slick solution.
[Thanks to Matt for the tip!]
Filed under: Arduino Hacks

Review – pcDuino v2
Introduction
Updated 29/01/2014 All pcDuino v2 tutorials
Update! The pcDuino version 3 is now available
In the last twelve months or so several somewhat inexpensive single-board computers have burst onto the market, and of those was the pcDuino. This has now evolved into the pcDuino v2, the topic of our review. The pcDuino v2 is billed as the “mini PC + Arduino”, a combination with much promise. Out of the box it runs a version of Ubuntu 12.04 on Linaro 12.07, or can also run Android Ice Cream Sandwich if so desired.
The pcDuino v2 is a single-board computer like many others, however with some interesting additions – the most interesting being the Arduino-shield hardware connections and pcDuino v2 Arduino development environment. We’ll first run through the pcDuino v2 as a Linux computer, and then delve into the Arduino-compatibility. But first, our test board… which arrived safely in a neat box:
… which contains the pcDuino v2 itself:
At first glance you can see the various points of interest, such as the Allwinner A10, which is a 1GHz ARM Cortex A8 CPU:
… the Realtek WiFi add-on board (which is fitted to the pcDuino v2):
… and also a USB socket (for keyboard, mouse, USB hub and so on), a microUSB for USB OTG use, a full-sized HDMI socket for full HD video, RJ45 Ethernet socket, a microSD socket for expansion, and the Hynix flash memory ICs. From the pcDuino v2 website, the specifications are:
Hardware:
- CPU – 1GHz ARM Cortex A8
- GPU – OpenGL ES2.0, OpenVG 1.1 Mali 400 core
- DRAM – 1GB
- Onboard Storage – 2GB Flash, microSD card (TF) slot for up to 32GB
- Video Output – HDMI
- OS – Linux3.0 + Ubuntu 12.04/Android ICS 4.0
- Extension Interface Arduino Headers
- Network interface – 10/100Mbps RJ45 and on-board WiFi module
- USB Host port 1
- Requires – Power 5V, 2000mA
- Overall Size 125mm X 52mm
Software
- OS – Ubuntu 12.04 (pre-loaded) or Android ICS 4.0
- APIs – all the Arduino shield pins are accessible with the provided API.
It consists of API to access the following interfaces: UART, ADC, PWM, GPIO, I2C, SPI
- Programming language support – C, C++ with GNU tool chain, Java with standard Android SDK, Python.
However at the time of writing all models with the date stamp of 17/09/2013 (and newer) have 4G of onboard flash storage – a great little bonus. With the addition of an inexpensive microSD card you can add up to an additional 32 G of storage.
Getting Started
This is the crunch-point for many products – how does one get started? With the pcDuino – very easily. Apart from the computer itself, you’ll need a monitor with HDMI inputs and speakers, a USB keyboard and mouse (with a USB hub – or one of those keyboard/trackpad combinations) and a power supply. The pcDuino v2 requires up to 2A at 5V – a higher-rated plugpack than usual. Don’t be tempted to use a normal USB socket – the pcDuino v2 will not work properly on the available current.
So after plugging all that in with the power the last to connect – the pcDuino v2 fires up in around five seconds, quickly running through the Ubuntu startup process and ended with the configuration screen in around five seconds:
After setting the time zone, language, screen resolution (full HD) and so on it was another ten seconds to the desktop:
At this point we found by accident that the A10 CPU runs hot – in some warmer permanent installations it could use a heatsink. But I digress. We now have a “normal” computer experience – the WiFi found the home network without any issue and the Chromium web browser runs well considering the speed and the RAM (1G) of the pcDuino v2:
The next step is to format the extra onboard storage, which can be done with the usual tool:
We just formatted it to ext4 and moved on. The included software is nothing unexpected, there’s the Chromium web browser, office-style applications, terminal, XBMC, remote-desktop viewer and of course you can hit up the Ubuntu package manager and install what you need.
It’s easy to get carried away and forget you’re not using a typical multi-GHz computer so bear that in mind when software runs a little slower than expected. However working with WordPress and Google Docs inside Chromium was acceptable, and a fair amount of this review was written using the pcDuino v2.
Excluding the Arduino development environment which we look at in the next section, pre-installed programming tools include Python (v2.7), C/C++ with GNU tool chain and Java with the standard Android SDK. At this point we haven’t tried the pcDuino with the Android operating system, however plan to do so in the near future and this will be the subject of a separate article.
At this point we’d say that the pcDuino v2 is a winner in the SBC (single-board computer) stakes, as you don’t need to worry about external WiFi, or deliberating about which version of an OS to use and then having to download it to an SD card and so on… the pcDuino v2 just works as a computer out of the box.
The pcDuino v2 as an Arduino
At this point we’d like to note that the pcDuino v2 is not an Arduino circuit wired up to a computer (such as the Arduino team did with the Yun). Instead, the pcDuino v2 is a computer that can emulate an Arduino – and has the GPIO pins and shield sockets onboard.
So when you run a sketch on the pcDuino v2’s version of the Arduino IDE – the sketch is compiled and then executed using the CPU, not an ATmega microcontroller. Speaking of which, the IDE is a modified version of 1.5.3 which appears identical to the usual IDE:
In fact when you compile and upload that blink.ino sketch everything runs as normal, and a small LED situated near D2/3 will blink as normal. However you do need to use more #include statements, for example #include <core.h> for all sketches. When uploading a sketch, a new window appears that will be blank, as shown below – this window needs to stay open otherwise the sketch won’t run
One of the benefits of using the pcDuino v2 is the extra space available for sketches – a quick compile shows that you can have a fair bit more than your typical ATmega328 – in our example we had 104,857,600 bytes available:
We don’t have a sketch that large, but at least you have some headroom to create them if necessary.
Arduino Hardware support
The shield header sockets are in the standard R3 configuration – and all GPIO is 3.3V and not 5V tolerant. However there is a conversion shield available if necessary. There are also some extra GPIO pins available – another eight, as shown in the following image:
At the time of writing there is support for GPIO use, SPI (up to 12 MHz, master-only), I2C (up to 200 kHz, at 7-bit and master-only), a UART (serial on D0/D1), PWM and ADC on A0~5.
However ADC is a little different, due to the internal reference voltages of the Allwinner CPU. Take note of the following as if you exceed the maximum voltages you could damage your board. Pins A0 and A1 are 6-bit ADCs, which return values from 0 ~ 63, which range from 0V to 2V. Pins A2~A5 are 12-bit ADCs, which return values from 0 ~ 4095, which range across the full 0V to 3.3V.
There isn’t access to the usual serial monitor in the Arduino IDE as such, instead you need to use an external, hardware-based solution such as connecting a USB-serial adaptor to pins D0/D1 and using another PC as the terminal. And when you press ‘reset’ on your Arduino shields – it resets the entire computer, just not the Arduino emulation – (learned that the hard way!).
However you can output text and data to the console window that appears after uploading a sketch – and doing so is pretty easy, just use prinf as you would in C or C++. For example, the following sketch:
#include <core.h> // example code from http://www.cplusplus.com/reference/cstdio/printf/ void setup() { // put your setup code here, to run once: } void loop() { printf ("Characters: %c %c \n", 'a', 65); printf ("Decimals: %d %ld\n", 1977, 650000L); printf ("Preceding with blanks: %10d \n", 1977); printf ("Preceding with zeros: %010d \n", 1977); printf ("Some different radices: %d %x %o %#x %#o \n", 100, 100, 100, 100, 100); printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416); printf ("Width trick: %*d \n", 5, 10); printf ("%s \n", "A string"); delay(1000); }
produces the following output in the console window:
It would be recommended to read this guide about using the pcDuino v2 as an Arduino which highlights pretty well everything to get you started, including the notes on interrupts and PWM – and this page which explains the headers on the pcDuino v2. Finally, as the “Arduino” is emulated you cannot use the on-board networking capabilities of the pcDuino v2 such as Ethernet, instead you use a shield as you would with a normal Arduino.
At first glance it may seem that the pcDuino v2 is difficult, which it is not. One needs instead to consider their needs and then work with the available features. Just like many other new development boards and systems, the pcDuino v2 (and pcDuino platform) is still quite new – but growing – so more features and compatibility will appear over time.
How much faster is the pcDuino v2 against a normal Arduino board?
There should be a great difference between the Arduino’s microcontroller and the A10 CPU, even taking into account running the OS and emulation. To test this, we’ll use a sketch written by Steve Curd from the Arduino forum. It calculates Newton Approximation for pi using an infinite series. The pcDuino v2 version of the sketch is below:
// // Pi_2 // // Steve Curd // December 2012 // // This program approximates pi utilizing the Newton's approximation. It quickly // converges on the first 5-6 digits of precision, but converges verrrry slowly // after that. For example, it takes over a million iterations to get to 7-8 // significant digits. // // I wrote this to evaluate the performance difference between the 8-bit Arduino Mega, // and the 32-bit Arduino Due. // #include <core.h> // for pcDuino v2 #include "Serial.h" #define ITERATIONS 100000L // number of iterations #define FLASH 1000 // blink LED every 1000 iterations void setup() { pinMode(13, OUTPUT); // set the LED up to blink every 1000 iterations Serial.begin(57600); } void loop() { unsigned long start, time; unsigned long niter=ITERATIONS; int LEDcounter = 0; boolean alternate = false; unsigned long i, count=0; float x = 1.0; float temp, pi=1.0; Serial.print("Beginning "); Serial.print(niter); Serial.println(" iterations..."); Serial.println(); start = millis(); for ( i = 2; i < niter; i++) { x *= -1.0; pi += x / (2.0f*(float)i-1.0f); if (LEDcounter++ > FLASH) { LEDcounter = 0; if (alternate) { digitalWrite(13, HIGH); alternate = false; } else { digitalWrite(13, LOW); alternate = true; } temp = 40000000.0 * pi; } } time = millis() - start; pi = pi * 4.0; Serial.print("# of trials = "); Serial.println(niter); Serial.print("Estimate of pi = "); Serial.println(pi, 10); Serial.print("Time: "); Serial.print(time); Serial.println(" ms"); delay(10000); }
As mentioned earlier, you can’t see the IDE serial monitor, so an external PC needs to be used. We connected a USB-serial adaptor running at 3.3V I/O to a PC:
Now back to the sketch. An Arduino Mega 2560 can do the calculation in 5765 ms, a Due 690 ms, and the fastest I saw the emulated Arduino in the pcDuino v2 do it was 9 ms:
Wow, that’s quick. However take note that the completion time was all over the place. When it was 9ms, the only application open was the pcDuino v2 Arduino IDE. The completion time increased when opening other applications such as Chromium, formatting a microSD card and so on.
Why is that? As the pcDuino v2 is emulating an Arduino, the CPU needs clock cycles to take care of that and all the other OS tasks – whereas a straight Arduino just runs the code generated by the IDE and compiler. Nevertheless the speed increase is welcome, and opens up all sorts of possibilities with regards to deeper calculations in sketches they may taken too long on existing hardware.
Support and Community
From what I can tell there is a growing base of users (including this one) and like everything else this will help the pcDuino platform develop and evolve over time. There is a Linksprite “Learning Centre” with a growing pcDuino v2 section, the website, wiki, and support forum which are useful sources of information and discussion.
Conclusion – so far
The pcDuino v2 is a great mix of single-board computer and Arduino-compatible power. There is a small learning curve, however the performance gains are more than worth it. Another USB socket wouldn’t go astray, and the documentation and support will increase over time. However we really liked the fact it’s totally plug-and-play with the onboard storage, OS and WiFi.
And finally a plug for my own store – tronixlabs.com – offering a growing range and Australia’s best value for supported hobbyist electronics from adafruit, DFRobot, Freetronics, Seeed Studio and much more.
Have fun and keep checking into tronixstuff.com. Why not follow things on twitter, Google+, subscribe for email updates or RSS using the links on the right-hand column, or join our forum – dedicated to the projects and related items on this website.
The post Review – pcDuino v2 appeared first on tronixstuff.
MariaMole – an alternate Arduino IDE aimed at advanced users
[Rodrigo] has been working with Arduino for some time now, but always thought it lacked some features which advanced users would really find useful. He decided to devote some free time to fixing the problem and ended up coding an Arduino IDE for more advanced users. A screenshot of his work — called MariaMole — can be seen above. It is obviously different from the standard IDE, bot not so much as to scare off new users.
This is meant to complement the original IDE, so it actually uses those configuration settings as dependencies. Once running, the program allows you to have multiple projects open at once. These are managed with the tree in the left hand column and a series of tabs along the top of the code window. When it comes time to compile and load the sketch you can click one button like normal, or use the program to fine tune your compiler flags, libraries includes, and the like. It also allows for interaction through one or more serial terminal windows. We haven’t tried it ourselves, so please leave a comment with your thoughts after having given it a go.
Filed under: arduino hacks

Labview and Arduino: 3Dmicro Toolkit Arduino Expansion (beta)
Massimo Introduces Arduino Leonardo
In this video Massimo explains the Arduino Leonardo, talking about its differences with Arduino UNO and playing around with its mouse & keyboard features.
If you want to have a closer look to the latest arrival in the Arduino Family click here, if you want to follow Massimo’s project click here. Arduino Leonardo comes in two different flavours: with headers and without headers.
Energia brings Arduino IDE to the TI Launchpad
The Arduino IDE is an abstraction layer for the AVR chip which the board is based around. So it’s no surprise that it is now possible to use the Arduino IDE with the TI Launchpad board. This makes it dead simple for beginners to play around with the inexpensive and low-power MSP430 platform. This is all thanks to a lot of hard work on part of the Energia developers.
The project branches from Arduino so the look, feel, and function are all about the same. Most notably, the color scheme has migrated to red to match the board color of the Launchpad. You can configure the hardware the same way by selecting a COM port and target board. Almost everything is already working, but you should check the known issues page so that you don’t try to use a function that hasn’t been ported. Right now the list includes the random and random seed functions, as well as tone, notone, and micros. There is also an issue with analogWrite; it will only produce half the requested frequency and duty cycle can only be set from 0-50%. Still this is a great development if you’re most comfortable working from this IDE.
Filed under: Microcontrollers

Programming Arduino on the cloud: codebender
codebender is web-based IDE, mainly built with HTML5 and Javascript, that focuses on the development for the Arduino platform. Since it is going to be used directly from the browser (note that currently codebender is still beta), it will further simplify the whole development process, avoiding the installation of software and libraries on the local machine.
From the home page of the project:
We want to lower the barrier to entry, which is necessary to help everyday people start their first project, become makers and advance technology instead of using it. codebender requires no installation, so you can get started with Arduino programming the minute you get one in your hands! And with the development tools we provide, you can do so faster and easier! codebender also stores your code on the cloud, so it’s safe and accessible from anywhere, anytime.
Several nice features will be available soon, such as remote flashing: together with an Ethernet shield flashed with a properly designed TFTP bootloader, you will be able to upload a sketch remotely, over the internet! Another nice feature regards its integration with the open documentation available on the Arduino website, which will be accessible directly from the IDE by selecting a piece of code and, then, by pressing ctrl+space.
More information can be found here.
[Via: HackADay and codebender's website]
Codebender: An online Arduino IDE
Because everything is moving to a web app, [Vasilis Georgitzikis], a.k.a. [tzikis] developed codebender, a cloud-based Arduino IDE replete with built-in libraries, documentation, and the ability to upload your code to an Arduino from a browser.
To compile an Arduino sketch, codebender uses clang a wonderful compiler that will give you extremely descriptive warnings on terrible code. Like any good IDE, there’s built-in highlighting and documentation, and a small bit of Java allows you to upload your code and monitor the serial port right in the browser.
One of the more interesting innovations is codebender’s (upcoming) use of a TFTP bootloader. With this and an Ethernet shield, it’s easy to upload code to any Internet-connected Arduino, whether it’s on your desk or halfway across the world. We can see that being very useful for a data logger or even a UAV balloon, and can’t wait to see it in action.
Filed under: arduino hacks

HTML based AVR compiler aims to make Arduino development on iOS possible
Programming arduino using your smartphone? Indeed! It is possible if we have the IDE in HTML5. With similar thoughts Tadpol started building a browser based AVR compiler. The project is still open for contribution at Github. Hackers, please contribute!
As seen on the screenshot, the current version uses various buttons to input the code.
The project, named Avrian Jump, uses a simple ladder language to feed the compiler, with several different options for output. The most interesting in our mind is a WAV file which can be used to program an AVR from the audio out of your device. That would make programming as simple as connecting the specially modified AVR to your headphone jack. There’s also an ASCII output which allows you to save your programs for later alteration, S19 output for AVRdude programming, and an assembler output for debugging purposes. It’s hard to
Via:[Hackaday]