I like numbers


Ethernet

A kid that I teach robotics to has begged me to show him some code examples of using an Etherten seeing as he just bought one. I’m not going to copy and paste more long and tedious code examples into my blog so I’m just going to give him some links.

The library and shield home:

http://www.arduino.cc/en/Reference/Ethernet

Lots of examples of ethernet and other comms.

http://arduino.cc/playground/Main/InterfacingWithHardware#Communication

The best example in my opinion (hint: this doesn’t work if you don’t type in the etherten’s IP address into the sketch (i.e. 1.2.45.6.10 blah blah blah). Don’t change the mac address.)

http://arduino.cc/playground/Code/WebServer

And don’t forget to read the instruction manual. I never read instruction manuals but you NEED to read this.

http://www.practicalarduino.com/freetronics/EtherTen_Getting_Started.pdf

And look at this amazingly cool project with arduino and ethernet. It should help you get started. It uses the same wiznet ethernet chip as  the etherten.

http://www.youtube.com/user/mrichardson23#p/c/3C4936C5BA46679D/18/DnFZsPlaknQ

There’s also a bit on this blog about ethertens and stuff.

That should get you started. 🙂

Display

Moving onto our main topic I’ve finally had a chance to test the server’s circuit. The main component of this is the display.

Display

The numeric display deeply nested inside the project

To test this I used the serial debugging program that I use to debug most things. You can find it in the category of Arduino Sketches.

So I set analog pins 1-4 high and digital pins 0-7 high and it all lit up.

Display lit up

All lit up.

Now the picture above may look at first like one for happiness and joy but I can assure you it’s not. The top and top left segments of the display are trouble. This is because they are hooked up to pins 0 and 1. Now pins 0 and 1 on the arduino do the TX and RX for the serial functions. This is bad. It means that these pins are inaccessible when using the computer with the board. I need to figure out a way around this.

So I tried having the arduino kind of  do a permanent Serial.print() command to keep the top segment (TX pin) bright. It worked. But what about the RX pin?

Time to build an ethernet debugger.

Nah I’m not that good.

Time to move away from the serial debugger and to a proper sketch.

I simply made a sketch that looked like this:

void setup() {
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(0, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);

}
void loop(){
 digitalWrite(A1, HIGH);
 digitalWrite(A2, HIGH);
 digitalWrite(A3, HIGH);
 digitalWrite(A4, HIGH);
 digitalWrite(0, HIGH);
 digitalWrite(1, HIGH);
}

And the pins lit up like this:

TX and RX pin lit up

Problem solved

I tested the tilt switch using the good old AnalogReadSerial sketch. It worked. Server security? Check.

I know the piezo worked because it made several loud noises when I accidentally turned it on a couple of times in the library while debugging. Annoying noises that can be turned on remotely? Check.

Last but definitely not least the LM35 temperature sensor worked when I tested it with a LadyAda sketch. My room is a t 19.1 degrees celsius.

See http://www.ladyada.net/learn/sensors/tmp36.html for the code

So that’s about it for circuit testing.

Boards

As promised here are some more cool boards that are on my wishlist. Not as much detail this time around because I am in a hurry. Just click on the images to find out more.

Chumby

Chumby hacker board

Panda board. This thing is awesome. Ethernet and HDMI.

Panda board. This thing is awesome. Ethernet and HDMI.

The Digilent Cerebot 32MX7. Ethernet and a PIC32.

The Digilent Cerebot 32MX7. Ethernet and a PIC32.

Mbed dev board. Boasts an ARM and Ethernet at Arduino Nano size.

Mbed dev board. Boasts an ARM and Ethernet at Arduino Nano size.

So that’s about all the boards I can think of at the moment that are worth mentioning. I’ll have to find some more for you guys.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s