Arduino Project – Simple LED

This was from the Arduino Project book I got, it’s not really much of a project as it’s mostly based on “assume nothing” type perspective.

Arduino and soderless breadboard mounted
Arduino Project starting spot.

When I start with a project I have the board setup something like this.  I am currently between projects (as I’m writing this) and have left the existing project setup.  This is how this ends up being setup from how The Arduino Starter Kit sets up your Arduino, and the working surface for it.

I took a fair number of pictures while I was working on this project, and most of them did not really work out that well.  I am not all that happy with this one even.

The project that I am writing about is only using the Arduino as a power supply (though in a way that is an important place to start with it).  So from this we connect the power to the breadboard.

pushbutton, LED, and "power leads"
Components used (missing some (I think) at least duplicate ones, and most wires) for the first project. Pushbutton, LED, and the “power leads”.

These are the components which I used for project.  Well, most of them.  There is a resister that gets used, and there is another pushbutton which is used.  Just a little bit of documenting some stuff.

From here I started to put things a bit together.  I attach the power leads (red and black cables).

Power connected to breadboard from Arduinio
Power connected between Arduino to breadboard.

This is a nice start for the project.  Connected from the power on the Arduino to the breadboard.  It starts here.  Not all that exciting.  But it comes along.

The first “phase” of the completed project, is really very simple.

Lit LED on Arduino development system
Very simple completed LED version. `

This is how the first version of first project works.  It is really simple.  About the simplest version that you can produce.

This unfortunately is the last picture I managed to get a good picture of.  Once I completed this project (which includes two versions with two pushbuttons, one with them wired in series, and then one with them wired in parallel).  Once I finished putting it all together, I worked on starting to get some circuit diagrams together and the first one is this version.

Arduino Project 001 – LED

I will leave this post at this point right now.  I’m going to pull this diagram up in KiCAD and see about drawing the other versions of the diagram.

Arduino Setup

I am not sure if this will end up split in multiple posts or not, but I have two broad topics being the hardware setup (which is basically, I mounted it, and I connected it to the computer with the USB cable provided) and the software setup (which has a bunch of things which I think are rather important to write about).  So let’s start with the software setup, as even though you need to do the hardware setup first, it’s simple, and I didn’t really “learn” anything important there.

Arduino Software Setup (this was done on Gentoo)

OK, so, I expected to run into some problems with this, but I just was looking at the “project book” that I got with The Arduino Starter Kit and the Linux instructions are “please go to the website”.  A bit of problem with even that instruction (and all of the instructions of that sort in the book) first being that doesn’t exist as a domain that serves actual content.  And second, some of the specific instructions just are not able to be followed at all.

Arduino provides an IDE (Integrated Development Environment) which needs to be installed (or something similar, which will provide needed tools for that, but we’re going with that, as so far the only alternative I have found is Eclipse, and I have had many problems with Eclipse) in order to work with the Arduino at all.

So, the instructions on the website, didn’t provide anything that looked like a good way on Gentoo (well, nothing specific to Gentoo, and everything else was specific to another distribution) so I looked to see what I could find in my portage directory (/usr/portage by default) and did find it, so dove in with that…

But, but, but…  It isn’t working out of the box…

The instructions I found said some stuff with /dev/ttyACM* which isn’t showing up…  OK so I need to figure that out, so I look at my kernel…  yep, I need to do some stuff with that…

I update the kernel, and I install it in /boot but I don’t “tell grub about it” which is a total rookie mistake (I know to do that, but I just forgot) and reboot, and “darn that kernel isn’t working”…  So i start looking for Gentoo instructions which I have found are often “old” and sometimes very outdated (ie. they not only don’t work as stated, but they flat out don’t work) but in this case, I can say yes, these are really pretty much correct.

I thought (having not realised at this point, that I wasn’t running the new one) that I needed to enable more stuff in the kernel, and enabled the other drivers that are listed on that page (I don’t think I needed them, but they don’t seem to be doing any harm) and then booted into the new kernel.

I can now see the device /dev/ttyACM0 but I still am not getting communication to the device.  And I start digging further as I have missed a step (I hope that is all at this point) and it was setting up user permissions.  I need to add the user I want to use to the group for the device, and that got the device showing up as available.

In the mean time, I start to work through the other options, and the first part says something about packages in “cross-avr” which I don’t have at this point, which actually ends up confusing me somewhat (because it doesn’t say “these may not be available at this time” oh look it actually says “these packages are not available until after you install crossdev” so I want to know why you are asking for something that will fail until such point as I’ve done that).

I have already done some stuff which is further down, so my process might be “somewhat broken” and I know I did stuff that I shouldn’t have needed to two twice, twice, or maybe more than that.

I tried to follow the instructions, but there are some problems that I ran into that they don’t get into, namely that you probably don’t want to install crossdev stuff into an overlay that already exists, and it was doing that for me (I haven’t seen if it ended up adding stuff to that overlay or not) and I had to figure this out through looking at the help for “crossdev”.

I had to run the command that is listed as crossdev -s4 --stable --portage --verbose --target avr multiple times to get it to work correctly, but once it did, it simply did (though I have to say, it takes a *long* time for it to happen, and there is no running output to show that something is happening).

Here is a case where Gentoo seems to fail on the “don’t provide enough information” side of things.  Or maybe more “don’t provide enough information in a way that it actually allows a person to look at what is being said, and readily find a solution to it from that source”.

I needed to tell crossdev exactly where I wanted it to “put stuff”.  I see no clear place where that information exists on the Gentoo website.  I don’t really know if where it was picking “automagically” was “wrong” other than it was putting stuff in an overlay which had no reference to…

Once that got installed, I then tried the “check this out” thing which failed earlier in the process looking at the crossdev-adm stuff.  I’m not sure I needed to do that or not really…

In the end, I found that I needed to create a symlink that it says “you also need a workaround” which somehow I put a “may” in…  Now it seems that everything is working (after once again trying to install the arduino ide, which I don’t know I need to do).

I then looked at the information they have with eclipse.  I couldn’t really get it working “well enough” to want to switch unless I could do my existing stuff better with it, but actually getting any of that setup was a pain (it took “forever” for it to finally tell me what I needed to do, in fact I left it overnight and it was saying “hey why not do it this way”).  So I am sticking (at least for now) with the arduino ide.

Hardware Setup

This was pretty much trivial.  The issues I ran into were of the “dropping little bits, but finding them quickly” sort.  Instructions that were in the “Project Book” which I found quite understandable, and it looks like (so far) I have done nothing problematic.  So now to play more with this…