Show Posts
Pages: [1] 2 3 ... 7
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: POV on: March 08, 2008, 05:41:30 am
Yes try with the array of bytes.
Here is an old code ( I 'm not sure if it 'll work with 7 lines instead of 5).

/*

????????????????????????????????????????????

persistence of vision typography with arduino

michael zoellner - march 2006

http://i.document.m05.de



connect anodes (+) of 5 leds to digital ports of the arduino board

and put 20-50 ohm resistors from the cathode (-) to ground.



the letters are lookup tables consisting arrays width the dot status in y rows.

????????????????????????????????????????????

*/





// defining the alphabet

byte _[] = {0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0};

byte A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1};

byte B[] = {1,1,1,1,1, 1,0,1,0,1, 0,1,0,1,0};

byte C[] = {0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1};

byte D[] = {1,1,1,1,1, 1,0,0,0,1, 0,1,1,1,0};

byte E[] = {1,1,1,1,1, 1,0,1,0,1, 1,0,1,0,1};

byte F[] = {1,1,1,1,1, 1,0,1,0,0, 1,0,1,0,0};

byte G[] = {0,1,1,1,0, 1,0,1,0,1, 0,0,1,1,0};

byte H[] = {1,1,1,1,1, 0,0,1,0,0, 1,1,1,1,1};

byte I[] = {0,0,0,0,1, 1,0,1,1,1, 0,0,0,0,1};

byte J[] = {1,0,0,0,0, 1,0,0,0,1, 1,1,1,1,1};

byte K[] = {1,1,1,1,1, 0,0,1,0,0, 0,1,0,1,1};

byte L[] = {1,1,1,1,1, 0,0,0,0,1, 0,0,0,0,1};

byte M[] = {1,1,1,1,1, 0,1,1,0,0, 0,1,1,1,1};

byte N[] = {1,1,1,1,1, 1,0,0,0,0, 0,1,1,1,1};

byte O[] = {0,1,1,1,0, 1,0,0,0,1, 0,1,1,1,0};

byte P[] = {1,1,1,1,1, 1,0,1,0,0, 0,1,0,0,0};

byte Q[] = {0,1,1,1,1, 1,0,0,1,1, 0,1,1,1,1};

byte R[] = {1,1,1,1,1, 1,0,1,0,0, 0,1,0,1,1};

byte S[] = {0,1,0,0,1, 1,0,1,0,1, 1,0,0,1,0};

byte T[] = {1,0,0,0,0, 1,1,1,1,1, 1,0,0,0,0};

byte U[] = {1,1,1,1,1, 0,0,0,0,1, 1,1,1,1,1};

byte V[] = {1,1,1,1,0, 0,0,0,0,1, 1,1,1,1,0};

byte W[] = {1,1,1,1,0, 0,0,1,1,0, 1,1,1,1,0};

byte X[] = {1,1,0,1,1, 0,0,1,0,0, 1,1,0,1,1};

byte Y[] = {1,1,0,0,0, 0,0,1,0,0, 1,1,1,1,1};

byte Z[] = {1,0,0,1,1, 1,0,1,0,1, 1,1,0,0,1};



int letterSpace;

int dotTime;



void setup()

{

  // setting the ports of the leds to OUTPUT

  pinMode(2, OUTPUT);

  pinMode(3, OUTPUT);

  pinMode(4, OUTPUT);

  pinMode(5, OUTPUT);

  pinMode(6, OUTPUT);

  

  // defining the space between the letters (ms)

  letterSpace = 6;

  // defining the time dots appear (ms)

  dotTime = 3;

  

}



void printLetter(byte letter[])

{

  int y;

  

  // printing the first y row of the letter

  for (y=0; y<5; y++)

  {

    digitalWrite(y+2, letter[y]);

  }

  delay(dotTime);

  

  // printing the second y row of the letter

  for (y=0; y<5; y++)

  {

    digitalWrite(y+2, letter[y+5]);

  }

  delay(dotTime);

  

  // printing the third y row of the letter

  for (y=0; y<5; y++)

  {

    digitalWrite(y+2, letter[y+10]);

  }

  delay(dotTime);

  

  // printing the sspace between the letters

  for (y=0; y<5; y++)

  {

    digitalWrite(y+2, 0);

  }

  delay(letterSpace);

}



void loop()

{

  // printing some letters

  printLetter(T);

  printLetter(O);

  printLetter(U);

  printLetter(T);

  printLetter(_);

  printLetter(_);  

}


2  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to convert analogRead value from accelerom on: March 05, 2007, 02:36:54 am
Ooops,

Sure you are right, so replace << by >> in my post (see the CosineKitty math tutorial, bit shift section http://www.arduino.cc/playground/Code/BitMath )

Thanks, others tipos ?

Nico
3  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to convert analogRead value from accelerom on: March 04, 2007, 11:14:28 am
Perhaps a stupid answer, but let's try it :

You said :
gvalue = [(ADCvalue * 3) / 1024 - 1.5] / 0.3 = [(ADCvalue * 3) / 1024 - (15/10)] / (3/10) = [(ADCvalue * 10) / 1024 - 5]

Assuming that << 10 divide by 1024

this 'll give you :

[((ADCvalue * 10)<<10)  - 5]   = [((ADCvalue * 5)<<9)  - 5] , but you will loose decimal precision

But if your target precision is around 1/10 of g (look at the datasheet or depend on what you want to do), you can compute :

10*gvalue = [((ADCvalue * 5*10)<<9)  - 5*10]  = [((ADCvalue * 25)<<smiley-cool  - 50]

This way you can avoid float

Not sure of what I am doing :-[, but CosineKitty (the Math expert) can probably confirm.

Nicolas
4  Forum 2005-2010 (read only) / Interfacing / Re: ttymidi - software for MIDI-through-USB for Li on: February 24, 2008, 12:14:40 pm
I tried it (ubuntu FF) .
Great !!!

FYI (and future release) : I noticed a tipo in the README/COMPILE (not a big deal)
You mean apt-get install libasound2-dev when you say apt-get install libasound-dev  

Thank U for that (including the doc)

Did you try it in real time with a master midi keyboard ?

Nicolas
5  Forum 2005-2010 (read only) / Interfacing / Re: ttymidi - software for MIDI-through-USB for Li on: February 04, 2008, 04:04:11 pm
Great, I was looking for something like that for a while now.

I'll give it a try.

Nicolas
6  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing via USB using libusb to arduino on: July 06, 2009, 03:04:27 pm
did you try tod code
http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/

Nicolas
7  Forum 2005-2010 (read only) / Interfacing / Re: Interfacing via USB using libusb to arduino on: July 05, 2009, 08:23:06 am
Try the serial proxy http://www.arduino.cc/en/Main/Software

Nicolas
8  Forum 2005-2010 (read only) / Development / Re: Compiling an SD/MMC and fat16 library on: January 08, 2008, 05:53:59 pm
Hi all,

For the hardware part here is a good link (I've not tested it) http://uanr.com/sdfloppy/

Nicolas
9  Forum 2005-2010 (read only) / Development / reduce arduino code size on: November 30, 2006, 11:34:28 am
If your arduino environment tells you that your sketch is oversized try this patch, you will save up to 1 Kbyte.

http://letateu.googlepages.com/Arduino-0006-optimization-patch20061128.zip

Enjoy it!!!

Note for Linux and OsX users : Has only been tested on windows, you will have to modify a little bit the distribution in order to see it working.
Let me know if that patch is working on your platform.

Nicolas
10  Forum 2005-2010 (read only) / Development / Re: Looking for a programer on: December 07, 2006, 11:46:42 am
Did you have a look at that http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1165363464 ?
11  Forum 2005-2010 (read only) / Development / 4 PWM on ATmega168, why not 6 ??? on: October 13, 2006, 09:51:57 am
I need 6 PWM output.
It looks like the wiring.c code lets me see 1 more PWM output (on digital pin 3) for the ATmega168.

But the ATmega168 data sheet shows about 2 more PWM outputs (for a total of 6).

Is it possible to have those 2 more PWM outputs for the Atmega168 on arduino ?

Nicolas
12  Forum 2005-2010 (read only) / Français / Re: Baisser la consommation de courant, possible ? on: November 29, 2008, 05:15:34 pm
tu devrais peut etre te repencher sur le sleep.h

J'ai qd meme l'impression en lisant la datasheet en diagonale que tu as un timer (le 2) qui reste actif et qui donc est utilisable pour faire une horloge

Nicolas
13  Forum 2005-2010 (read only) / Français / Re: Baisser la consommation de courant, possible ? on: November 20, 2008, 08:40:30 am
Je confirme : je viens de comparer les distributions en version 10 et 12 pour mac et tu as power.h uniquement sur la 12.

Bonne suite.

Nicolas
14  Forum 2005-2010 (read only) / Français / Re: Baisser la consommation de courant, possible ? on: November 20, 2008, 08:37:17 am
Je suis au travail donc je peux pas regarder mais je viens de jeter un oeil sur les releases notes de la version 12 ils parlent de :

* Upgraded to newer versions of avr-gcc (4.3.0) and avr-libc (1.6).  This
  provides support for newer Atmel chips, but may increase the size
  of sketches.

Peut etre qu'en passant à cette version de avr-libc tu auras la lib ?

Nicolas
15  Forum 2005-2010 (read only) / Français / Re: Baisser la consommation de courant, possible ? on: November 16, 2008, 05:07:18 pm
comment sais tu que tu n'as pas la lib ?
tu es allé voir dans ton .../avr/include/avr/ (sur mon linux c'est dans /usr/avr/include/avr/power.h) ?
Essaye de setter une autre board (genre NG atmega168 pour voir si ca marche la compil).

Nicolas
Pages: [1] 2 3 ... 7