Arduino simple command line interface [edit]

I blog therefore I am…

Long time now that I hack around here but I never really took the time to publish or document my work. Let’s change that!

It’s been a while that I was thinking about it, but as I was starting another arduino (for blog cred.?) project, I decided to take the time to implement a small command line interface for arduino. Continue reading Arduino simple command line interface [edit]

Using AVRISP mkII and Arduino IDE under Ubuntu lucid

If like me you would like to upload your sketches using the AVRISP mkII under Linux like you can easily do under OSX, I suggest the following procedure:

1. Add the following text to board.txt (located in the relative path hardware/arduino in your arduino installation folder)

jivedingo wrote it on arduino forum

##############################################################

avrispmkii_168.name=AVRISP mkII w/ ATmega168

avrispmkii_168.upload.protocol=avrispmkii
avrispmkii_168.upload.maximum_size=14336
avrispmkii_168.upload.speed=19200
avrispmkii_168.upload.using=avrispmkii

avrispmkii_168.bootloader.low_fuses=0xff
avrispmkii_168.bootloader.high_fuses=0xdd
avrispmkii_168.bootloader.extended_fuses=0x00
avrispmkii_168.bootloader.path=atmega
avrispmkii_168.bootloader.file=ATmegaBOOT_168_ng.hex
avrispmkii_168.bootloader.unlock_bits=0x3F
avrispmkii_168.bootloader.lock_bits=0x0F

avrispmkii_168.build.mcu=atmega168
avrispmkii_168.build.f_cpu=16000000L
avrispmkii_168.build.core=arduino


##############################################################

avrispmkii_328.name=AVRISP mkII w/ ATmega328

avrispmkii_328.upload.protocol=avrispmkii
avrispmkii_328.upload.maximum_size=30720
avrispmkii_328.upload.speed=57600
avrispmkii_168.upload.using=avrispmkii

avrispmkii_328.bootloader.low_fuses=0xFF
avrispmkii_328.bootloader.high_fuses=0xDA
avrispmkii_328.bootloader.extended_fuses=0x05
avrispmkii_328.bootloader.path=atmega
avrispmkii_328.bootloader.file=ATmegaBOOT_168_atmega328.hex
avrispmkii_328.bootloader.unlock_bits=0x3F
avrispmkii_328.bootloader.lock_bits=0x0F

avrispmkii_328.build.mcu=atmega328p
avrispmkii_328.build.f_cpu=16000000L
avrispmkii_328.build.core=arduino

##############################################################

2. Backup arduino’s avrdude and use your local avrdude
It seams that the avrdude binary coming with arduino 018 distribution isn’t compiled with usb support.
If your remove it and link your local avrdude binary instead, upload using mkII works like a charm.

# apt-get install avrdude libusb
# cd /path/to/arduino/folder
# cd hardware/tools
# ln -s avrdude avrdude.without-usb-support
# ln -s `type avrdude | cut -d "(" -f 2 | cut -d ")" -f 1` avrdude

Then you will be able to select AVRISP mkII \w ATmega328 or AVRISP mkII \w ATmega168 from the tools>board menu.

RECYCLING: a spoon against XDCAM Transfert

Tonight a friend came with her brand new Mac and a lot of files to import using XDCAM Transfert.
It seams that this software was made by tired developers, so we had to generate previews on every clip before importing.
Well, the real problem isn’t that you have to select the folder, but the fact that you have wait about one second for previews generation (no, there is no “group function”).

With about 3’500 folder, we would have been quickly mad.

And of course, moving all files in one folder isn’t possible, because they already are sorted.
There is probably many other (programmatic and smarter) solutions, but the punk-ier still is the funn-ier, no ?

So my solution is to recycle an old project, writing this post and going for a nice diner, while the mechanism goes by it-self…

PS: I guess it’s a good way to test keyboards…

#include 

Servo servo;

int servo_pin = 9;

void setup ()
{	
  servo.attach(servo_pin);
  Serial.begin(57600);
  Serial.println ("Finished setup\n");
}

void loop ()
{
  servo.write(115);
  delay(250);
  servo.write(80);
  delay (1000);
}