views:

754

answers:

12

I got interested in hardware programming lately and I was wondering what would be the best choice for me as an electronics amateur. I'm not looking for low-level programming in assembler and creating circuit boards.

Rather I would like something with API for high-level languages, preferably C# and pre-made components like USB interface boards in which I can plug simple sensors, motors etc. and build some "gadget", maybe a simple robot and so on...

So far I've found Phidgets but there are only a few sensors and it's also quite expensive.

So, the question is: Do you know about any other "platform" with good API and large selection of sensors?

+9  A: 

Take a look at Arduino. There's a ton of fun things you can do with one listed on Make.

Dan Vinton
+3  A: 

Check my question about microcontroller here. Also: How to Start programming microcontroller.

I have order for chritsmas the popular microcontroller Arduino. You cannot program with C# but they have a framework over the normal Assembly/C that make it simpler to interact.

Daok
Arduino looks interesting. I guess I could use the C API with P/Invoke. But I would still need to build the inputs / outputs myself. This is the good thing about Phidgets, it's already prebuild.
lacop
+2  A: 

Hard to beat Arduino and Processing

aneccodeal
+1  A: 

There is also Bug Labs which produces a number of hardware modules that can be connected together to build arbitrary gadgets. The modules look really slick (but I haven't seen them in real life).

Greg Hewgill
+4  A: 

If you want to use C# have you looked at the .NET Micro Framework? The SDK is free, plugs into Visual Studio, comes with a complete emulator, and there are several dev kits available for a pretty reasonable price.

The Tahoe is substantially more, but it also comes with a TFT display (and support for it) so the price is still not unreasonable.

As for sensors, all of these support I2C and SPI interfaces, so the number of peripherals available is well into the thousands. You're going to probably have to do some rudimentary soldering for some of them (resistors, etc) but if doing that scares you then you are probably headed down the wrong path anyway.

ctacke
+2  A: 

For many years, I've been a huge fan of the PIC series of microcontrollers from Microchip Technology. They have a wide range of microcontrollers with varying features, from super tiny to integrated wireless. You can pick up one of their PicStart kits for about $50 which includes the software, programming device, and a sample microcontroller. They can be programmed in C, assembly, BASIC, etc.

I originally got my start in microcontroller programming with a Parallax Basic Stamp, but they're rather limited an expensive ($50 ea, compared to $1-6 for a PIC) and can only be programmed in BASIC, though they are brain-dead simple to use.

rmeador
CCS puts together a great compiler and learning kits based on PICs as well. Yes, it a C compiler, but they have a lot of pre-built libraries for a lot of peripherals and protocols to make life pretty easy on the beginner.
ctacke
A: 

I dunno how much "hardware programming" you'll be able to get into without actually dealing with hardware. C# will only get you so far in the hardware world, as most everything is in C and sometimes C++.

If you decide you want to explore hardware design, the Nexys 2 board from Digilent is an excellent way to learn about hardware design using VHDL or Verilog. If you want to expand into microcontrollers, The Xilinx Embedded Developer Kit lets you custom configure a microcontroller system using the MicroBlaze softcore processor that will be implemented in hardware, and provides an IDE to write your C code that will run on the embedded platform.

Digilent also has a bunch of expansion boards like temperature sensors, video decoders, joysticks, servo controllers, etc. that you can use with their programmable logic boards.

Bob Somers
+1  A: 

What about Lego Mindstorms? They have a 32-bit CPU on which a VM runs, which even supports multithreading. The VM can be programmed in assembler.

I played with them some time ago, and it was quite an interesting and fun experience.

Nils
there's a Lua port to mindstorms, so it covers the 'high-level' part of the question.
Javier
The sensor choice is really small for mindstorms / NXT ...
lacop
A: 

I would get one of those .NET-chips and make myself a .NET Coffee Machine. Or somewhat like that, getting a PIC is just useless, you need to know low level languages like C and assembler.

There are simmilar components for Java.

See: Basic USB - Using Microchip Stack and C#.NET - Hardware.

Filip Ekberg
Parallax has a very popular BASIC compiler for PIC, so it doesn't have to be C or ASM. And PICs are far from useless.
ctacke
A: 

If the embedded system you will be working with has a ANSI C compiler it can run Lua (www.lua.org), all you need is to compile the source to your device. I once spoke with one of the developers of the language, he said he had one of the mailing lists web server (also written in Lua) of the language running in a cellphone for a while just to test it.

With Lua you can interface the sensors of whichever device you will be working with in C or C++ and have the functions called from inside Lua high level code.

Hoffmann
+1  A: 

Check out "Coin-Cell-Powered Embedded Design" (available as a download, PDF, 7 MB). It's a free text book for programming their microcontroller. The board is $80, though.

devin
+1  A: 

BASIC Stamp is the way to go.

tdavisjr