Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: software serial2 on: January 12, 2009, 03:36:28 am
I'm using a 1200 baud serial device (7E1) but even if I try several value around 946, I didn't suceed to find a proper value for bitDelay in the .ccp file.
How to calculate it ?
2  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: LiquidCrystal() constructor documentation error?? on: October 20, 2008, 02:36:17 pm
I agree with you edringel, my experience is the same.
One other point is that is not necessary to connect RW, so this parameter should be optional (seems to work when setting it to 0).
3  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Arduino-0009 and avrdude for uploading on: August 07, 2007, 03:10:49 pm
Can I expect the Tuxgraphics AvrUsb500 STK500 (open source Atmel AVR Programmer) to be compatible with Arduino 0009 ? I succesfully programmed a ATMega8 with avrdude and this interface on my Powebook G4. I have to give it a try soon.
Thanks for such a nice feature !
4  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: 31250 bauds monitor on: July 09, 2007, 10:23:54 am
Quote
Yes, it would be cool.  Unfortunately, the library (RXTX) we're using to do serial communication doesn't support 31250 - and I'm not sure the FTDI drivers do either (though you can modify them on Windows so that what appears to your software to be 38400 is actually talking to the hardware at 31250).  

I will try this tips. But where can I change this ? Is there any setting files (sorry I haven't yet try to 'hack' Arduino) ?

Quote
The second suggestion is interesting.  I can see why it would be convenient to be able to continue to monitor the serial port as you update your code.

Sorry if was not clear enough, I meant that the monitoring stay active even after an upload, not during the upload. The problem is that monitoring is no more activated after an updload. When I'm developping a code and need debugging then recoding then re-uploading, it's a pain to have to reactivate the monitor button. I see two options, a detached and always active monitoring window or to insert the output from the compilation and upload process in the debug traces but in a different color.
Like on some IDE (like Eclipse, to speak Open Sources), the console include application debugging and compilation output.
5  Forum 2005-2010 (read only) / Bugs & Suggestions / 31250 bauds monitor on: July 08, 2007, 02:53:27 pm
Hi, I'm an Arduino board user for midi projects.
As Arduino is often used with Midi, I think it maybe very usefull is monitor baud rate could be set to 31250 bauds.
One other suggestion is to let the monitoring mode activated even after an upload.
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: use of define on: August 17, 2007, 08:42:44 am
That's a bit tricky, but I will work.
I can now finished to port a Game of Life on MAX7219.
7  Forum 2005-2010 (read only) / Syntax & Programs / use of define on: August 17, 2007, 07:51:36 am
I would like to set the size of array with a #define command.

It works like a charm when using this syntax :
Code:
#define test 8
int first[test][test];
But not at all when using it in a function :
Code:
#define test 8
int second(int parameter[test][test]) {}
 
The compilation failed and said : error: 'test' was not declared in this scop.

I do not unsterstand why. As the 2 dimensionnal array may vary from [8][8] to [20][70], I would like to save some memory at the compilation step.

Thanks for your help !
8  Forum 2005-2010 (read only) / Interfacing / Re: Arduino and 1-wire on: July 12, 2007, 07:19:08 am
Don't know if you need more code sample for One Wire, but the project OWW is open source and addresses a lot of One Wire devices :
http://oww.sourceforge.net
9  Forum 2005-2010 (read only) / Interfacing / 1-wire temperature reading on: August 29, 2007, 08:33:35 am
Based on the OneWire lib, I've wrote the following code to convert the DS18S20 reading into Celcius Degres. Please note my code display the High Resolution Mode.
I would like to create a library with some other component (DS2438 for voltage then Barometer, Humidity, etc...). But the first step is to validate with you my code and my syntax. So your comments are welcomed.

Code:
void DisplayTempHR(byte Temperature_LSB, byte Temperature_MSB, byte Count_Remain, byte Count_per_C)
{
  boolean SignBit = false;
  int Temperature;
  byte Whole;
  byte Fract;
  
  // Truncate the 0.5°C bit (the LSB) from the read value.  
  Temperature = Temperature_LSB>>1;

  // The MSB is the sign extension
  if (Temperature_MSB != 0)
  {
    SignBit = true;
    // set the sign bit
    Temperature |= B10000000;
  }
 
  // Temp = TempRead - 0.25 + (CountPerC-CountRemain)/CountPerC
  Temperature = Temperature<<8;

  // Ox40 is Ox100/4, the 0,25
  Temperature = Temperature - 0x40 + (((Count_per_C - Count_Remain)<<8)/Count_per_C);
  
  // Compute the complement if signbit set to 1
  if (Temperature >> 15)
  {
    SignBit = true;
    Temperature = ~Temperature;
  }
  Whole = Temperature>>8;
  Fract = ((Temperature % 0x100) * 0x64 ) >> 8;

  Serial.print(" Temp=");
  if (SignBit) Serial.print("-");
  Serial.print(Whole, DEC);
  Serial.print(".");
  if (Fract <10) Serial.print("0");
  Serial.print(Fract, DEC);
}
10  Forum 2005-2010 (read only) / Français / Re: Projet "PowerMeter": conseil et pledgie on: May 11, 2009, 03:22:58 pm
C'est une simple initialisation du port série en 1200 bauds.
Pour vous aider, voici le code, qui mériterait d'être un peu mieux présenter, mais le projet est en pause.
http://www.copypastecode.com/codes/view/5079
11  Forum 2005-2010 (read only) / Français / Re: Projet "PowerMeter": conseil et pledgie on: March 16, 2009, 03:33:00 pm
Salut,

Je travail actuellement sur ce projet. Il faut absolument une interface avec un optocoupleur (6N138) pour protéger le circuit et ensuite un trigger de schmitt (74LS132) pour redresser le signal.
Je suis parti de ce montage. Ainsi le signal peut être lu en 1200 bauds directement sur le port série de l'Arduino.
Avec une Ethernet Shield, j'envoi l'index sur une page en PHP :
.
Il faut que je termine le code et surtout que je le commente.
12  Forum 2005-2010 (read only) / Français / Re: LCD4bits et characteres personalises on: December 11, 2007, 02:55:05 pm
J'ai fait exactement ça pour le TouchPad midi. Voici le code uniquement pour le LCD :
Code:
#define LCD_RS      8      // Register select
#define LCD_EN      9      // Enable
#define LCD_D4 10      // Data bits
#define LCD_D5 11      // Data bits
#define LCD_D6 12      // Data bits
#define LCD_D7 13      // Data bits

/**********************************************************************
 *
 * LCD
 * Based on 4bit interface example
 * 2006 Massimo Banzi
 * Based on code written by Craig Lee 1998
 * 2007 Ludovic Drochon : LCDbar127
 *
 **********************************************************************/
 
void lcd_strobe()
{
      digitalWrite(LCD_EN,HIGH);
      digitalWrite(LCD_EN,LOW);
}

/* write a byte to the LCD in 4 bit mode */

void lcd_write(byte c)
{
      if(c & 0x80) digitalWrite(LCD_D7,HIGH); else  digitalWrite(LCD_D7,LOW);
      if(c & 0x40) digitalWrite(LCD_D6,HIGH); else  digitalWrite(LCD_D6,LOW);  
      if(c & 0x20) digitalWrite(LCD_D5,HIGH); else  digitalWrite(LCD_D5,LOW);  
      if(c & 0x10) digitalWrite(LCD_D4,HIGH); else  digitalWrite(LCD_D4,LOW);  
      lcd_strobe();
      if(c & 0x08) digitalWrite(LCD_D7,HIGH); else  digitalWrite(LCD_D7,LOW);
      if(c & 0x04) digitalWrite(LCD_D6,HIGH); else  digitalWrite(LCD_D6,LOW);  
      if(c & 0x02) digitalWrite(LCD_D5,HIGH); else  digitalWrite(LCD_D5,LOW);  
      if(c & 0x01) digitalWrite(LCD_D4,HIGH); else  digitalWrite(LCD_D4,LOW);  
      lcd_strobe();
      delayMicroseconds(40);
}

/*
 *       Clear and home the LCD
 */

void lcd_clear(void)
{
      digitalWrite(LCD_RS,LOW);

      lcd_write(0x1);
      delay(2);
}

/* write a string of chars to the LCD */

void lcd_puts(const char * s)
{
    digitalWrite(LCD_RS,HIGH);      // write characters

      while(*s) lcd_write(*s++);
}

/* write one character to the LCD */

void lcd_putch(byte c)
{
    digitalWrite(LCD_RS,HIGH); // write characters

      lcd_write(c);
}


/*
 * Go to the specified position
 */

void
lcd_goto(byte pos)
{
    digitalWrite(LCD_RS,0);

      lcd_write(0x80 + pos);
}
      
/* initialise the LCD - put into 4 bit mode */

void
lcd_init(void)
{              
  
  
  pinMode(LCD_D7,OUTPUT);            
      pinMode(LCD_D6,OUTPUT);
      pinMode(LCD_D5,OUTPUT);
      pinMode(LCD_D4,OUTPUT);
      pinMode(LCD_EN,OUTPUT);        
      pinMode(LCD_RS,OUTPUT);        
      
      digitalWrite(LCD_RS, LOW);      // write control bytes

      delay(15);// power on delay

      digitalWrite(LCD_D4, HIGH);      // init!      
      digitalWrite(LCD_D5, HIGH); //
      lcd_strobe();
      delay(5);

      lcd_strobe();// init!      
      delayMicroseconds(100);

      lcd_strobe();// init!      
      delay(5);

      digitalWrite(LCD_D4, LOW);      // set 4 bit mode
      lcd_strobe();
      delayMicroseconds(40);
      
      lcd_write(0x28);// 4 bit mode, 1/16 duty, 5x8 font, 2lines
      lcd_write(0x0C);// display on
      lcd_write(0x06);// entry mode advance cursor
      lcd_write(0x01);// clear display and reset cursor
}

void downloadcustomcharacter(int CGRAMaddress, byte character[])
{
  for (int i = 0; i<8; i++) //load character bytes in to CGRAM
  {
    lcd_putch(character[i]);  
  }
  delay(20);
}

void setup() {
  delay (20);
  lcd_init();
  delay (200);
  lcd_write(0x40);
  //delay(40);
  byte barre1[] = {0x00,0x1F,0x00,0x00,0x00,0x00,0x1F,0x00}; //progress bar characters
  byte barre2[] = {0x00,0x1F,0x10,0x10,0x10,0x10,0x1F,0x00};
  byte barre3[] = {0x00,0x1F,0x18,0x18,0x18,0x18,0x1F,0x00};
  byte barre4[] = {0x00,0x1F,0x1C,0x1C,0x1C,0x1C,0x1F,0x00};
  byte barre5[] = {0x00,0x1F,0x1E,0x1E,0x1E,0x1E,0x1F,0x00};
  byte barre6[] = {0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x00};
      
  downloadcustomcharacter (0 , barre1);
  downloadcustomcharacter (1 , barre2);
  downloadcustomcharacter (2 , barre3);
  downloadcustomcharacter (3 , barre4);
  downloadcustomcharacter (4 , barre5);
  downloadcustomcharacter (5 , barre6);
 }

void loop() {
    }
13  Forum 2005-2010 (read only) / Development / MIDI Arpeggiator on: July 16, 2007, 03:38:09 pm
Arpeggiator is a missing piece in my music setup.
An Arduino and several MIDI connectors are available in the mess...

But is it possible to make a simple arpeggiator ? Do the Arduino have a sufficient CPU for this task ?
Just wanted to known before starting to write the code.

Thanks !

PS : it really nice to work with the Arduino. I've interfaced a Touchpad and MIDI. 2D control (ie: cutoff and resonnance).
14  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino 009 autoupload to diecimila on: August 22, 2007, 03:45:13 am
After playing with a Decemilia, I would like to have the same auto upload feature on my NG. Is it possible to retrofit my NG board ?
15  Forum 2005-2010 (read only) / Interfacing / Re: Long(ish) Distance Communication on: August 07, 2007, 03:21:19 pm
RS485 may help you. It is a serial protocol like the RS232 but with better distance support.
As mentionned in this thread, take a look to MAxim's MAX489 RS485 drivers.
Pages: [1] 2