Show Posts
Pages: 1 [2] 3 4 5
16  International / Français / Re: Installation sous Mageia Linux on: June 22, 2013, 10:21:05 am
Dans ce post, vous trouverez un paquet spécialement conçu pour Mageia3. En ftp.blogdrake.net il ya aussi une version pour Mageia 2.
Please see http://forum.arduino.cc/index.php?topic=172877.0
17  International / Software / RPM de arduino para Mageia 3 (y otras distribuciones basadas en RPM) on: June 19, 2013, 03:38:30 am
Este post es para informar que está disponible un paquete RPM de Arduino para Mageia 3

El binario oficial de Arduino hecho por Mageia no funciona. A demás, magia usa vesiones nuevas de AVR-GCC que no son totalmente compatibles con los los fuentes de Arduino. Para solucionarlo he creado un nuevo paquete basado en los binarios oficiales de Arduino con unos pocos cambios (que explico al final). El paquete funciona sin problemas simplemente con instalarlo y no necesita modificar grupos o permisos ni reinicios.

Instrucciones:

Para 32 bits:

Alternativa 1 (preferible porque permite actualizaciones automáticas):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/i586
urpmi arduino
Alternativa 2 (instalación manual):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/i586/arduino-1.0.5-1bdk.mga3.i586.rpm
Para 64 bits:

Alternativa 1 (preferible porque permite actualizaciones automáticas):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/x86_64
urpmi arduino
Alternative 2 (instalación manual):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/x86_64/arduino-1.0.5-1bdk.mga3.x86_64.rpm

El paquete también está disponible en el repositorio para mageia 2 y debería funcionar en otras distribuciones basadas en RPM.

Explicación de los cambios:
  • El paquete incluye todos los binarios oficiales de Arduino para mantener máxima compatibilidad con la excepción de:
  • He reemplazado la biblioteca RXTX library con los siguientes diferencias:
    • Se ha deshabilitado el bloqueo de puertos para que no sea necesario agregar el usuario al grupo lock
    • Se ha agregado la detección de los dispositivos /dev/ttyACM y /dev/arduino devices
  • He agregado una nueva regla de udev que:
    • Asigna por defecto los permisos 666 al conectar el Arduino para evitar la necesidad de agregar el usuario al grupo dialout.
    • Se ha agregado un enlace al dispositivo con el nombre "arduiono" para que se cree automáticamente un /dev/arduino
18  Using Arduino / Installation & Troubleshooting / Arduino RPM for Mageia 3 on: June 19, 2013, 03:29:27 am
Just informing that I created an RPM packet for Mageia 3

The official Mageia binaries does not work. Also, Mageia binaries has another problem: it uses a newer version of AVR-GCC that is not compatible with all Arduino sources. Then I created a new packet based on the official binaries with a little changes. The packet "just works" and don't need to change any permissions or groups.


Instruction for usage:

For 32 bits:

Alternative 1 (better because it auto-updates with new versions):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/i586
urpmi arduino
Alternative 2 (manual install):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/i586/arduino-1.0.5-1bdk.mga3.i586.rpm
For 64 bits:
Alternative 1 (better because it auto-updates with new versions):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/x86_64
urpmi arduino
Alternative 2 (manual install):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/x86_64/arduino-1.0.5-1bdk.mga3.x86_64.rpm

The packet is also available for mageia 2 and should work in other rpm based distros.

Explanation of the changes:
  • The packet includes all the official binaries for maximum compatibility except for:
  • I replaced the RXTX library with the following changes from official binaries:
    • Disabled port locking avoiding the need of adding the user to lock group
    • Added /dev/ttyACM and /dev/arduino devices
  • I added a new udev rule that:
    • Sets the default permissions of the arduino device to 666 for avoiding the need of adding the user to dialout group.
    • Added a link to the device named arduino for auto creating the /dev/arduino device
19  Using Arduino / Installation & Troubleshooting / which avr-gcc on linux on: March 05, 2013, 04:23:00 pm
I am trying to compile binaries for arduino for creating mageia 3 rpms. I can build the arduino ide and I can compile avr-gcc without problems. But, avr-gcc version 4.3.2 and 4.3.3 does not support the atmega32u4 of leonardo. Earlier versions like 4.6.2 (which generates much smaller binaries) do but has problems with some sources (i.e. can't compile ethernet library).

I red that the binaries of arduino includes 4.3.2 but I think it must be patched to support leonardo. ¿Where can I found that patch and/or instructions for compiling the right avr-gcc?

20  Using Arduino / Programming Questions / Re: Using PROGMEM data on: February 15, 2013, 09:41:35 am
Perhaps this will be fixed some day. For now it is a little inconsistant.

Ok, I understand.

But I've found stranges different results when I use F() and PSTR() in Serial.println. In a sketch that uses ethercard for tcp/ip (high memory usage), I had problems of garbage sent to Serial instead of some constant strings. I thought that PSTR was stored on flash, then it can't be modified after uploading the program. Then, I suppose PSTR is copying the string to RAM or something like this. This sould not be problem but I received the garbage... Then I replaced PSTR with F and the problem was solved... but F can only be used in Serial.print and a few places, PSTR works with sprintf, strcmp, etc.
21  Using Arduino / Programming Questions / Re: Is there a function to compare two const __FlashStringHelper* strings? on: February 15, 2013, 08:47:16 am
I am investigating about this.

I'm trying to do something like this:

sprintf(buf,F("<br><br><input type='submit' value='Relay 1' class='c%d' onclick='f(1,%d)'>"),digitalRead(RELAY1),digitalRead(RELAY1));

But I receive this error:

cant convert  ‘__FlashStringHelper*’ to ‘const char*’ for argument 2 for ‘int sprintf(char*, const char*, ...)’

I've found I can do this:

sprintf_P(buf,PSTR("<br><br><input type='submit' value='Relay 1' class='c%d' onclick='f(1,%d)'>"),digitalRead(RELAY1),digitalRead(RELAY1));

But I don't know the difference between F() and PSTR(). Can't find clear documentation about this.

22  Using Arduino / Programming Questions / Using PROGMEM data on: February 15, 2013, 08:20:01 am
I was reading the reference about PROGMEM data (http://www.arduino.cc/en/Reference/PROGMEM)
and I've found in internet examples using thing like this:

Serial.println(PSTR("this is a test"));

But I've also found this case:

Serial.println(F("this is a test"));

I'm tried both in one program where has ram problems, and found that the second case works better. My question is what is the difference? In which case should I use each one?

I've also seen some places where they uses P() instead of F()

I've found that there is a very usefull sprintf_P() function that can use PSTR() as parameter but if I use F() instead, the compiler reports an error.

23  Using Arduino / Programming Questions / Declaration of progmem constant string on: February 08, 2013, 01:41:52 pm

I am trying to declare a progmem string just like in the documentation (http://arduino.cc/es/Reference/PROGMEM)

I wrote a little program like this:

Code:
prog_uchar signMessage[] PROGMEM  = {"I AM PREDATOR,  UNSEEN COMBATANT. CREATED BY THE UNITED STATES DEPART"};

void setup(){
}
void loop(){
}

And when I try to compile, I receive this error:

sketch_feb08b.ino:2:26: error: variable 'signMessage' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

¿Any ideas on what is the problem?

(I'm using Arduino 1.0.3 under linux).
24  International / Hardware / Receptor de termómetro inalámbrico 433Mhz on: December 04, 2012, 11:35:58 am
He estado haciendo un programa para recibir la transmisión de un termómetro inalámbrico. Ya lo tengo funcionando pero como he visto que no hay mucha información al respecto, y que este tipo de termómetros parecen bastante comunes porque son muy baratos, les paso a continuación el programa final y un link a la descripción completa que he puesto en internet. Espero que les resulte útil:







http://alejandro-anv.blogspot.com.es/2012/12/hackeando-termometro-inalambrico.html



Code:
#include <PinChangeInt.h>
#include <ByteBuffer.h>


#define DATA 8
#define BUFLEN 20
#define MAXBITS 32


ByteBuffer buffer;

unsigned long paquete=0L;
byte bits_paquete=0;


//////////////////////////////////////////////////

void cambio() {
unsigned long m;
static unsigned long dur_low;
static unsigned long dur_high;
static bool recibiendo=0;
static unsigned long lmicros=0;
static unsigned long hmicros=0;

m=micros();
if (digitalRead(DATA)==HIGH){  //flanco de subida
    hmicros=m; 
 
    dur_low=m-lmicros;

    //si el ultimo pulso alto duro 1ms, es un separador de pulsos y hay que procesar este dato
    if (recibiendo){
       if (dur_low<1800L) return; //tiene que tener por lo menos 1,8ms
       if (dur_low>8000L) { //si es un pulso de 10ms, es un fin de paquete
           digitalWrite(13,HIGH);
           procesar_paquete();
           return;
           }
       digitalWrite(13,LOW);           
       agregar_pulso(dur_low>3000L);  //si el pulso es de 5ms, es un 1, si es de 2 ms es un 0
       }
   
   
    return;
    }   
//flanco de bajada

lmicros=m;
dur_high=m-hmicros;
//si es un pulso de 0,5ms estamos recibiendo datos
if (dur_high>400L && dur_high<900L) {
    recibiendo=1;

    }
else {
    bits_paquete=0;
    recibiendo=0;
    paquete=0L;
    }

}

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
void agregar_pulso(bool valor){
paquete=(paquete<<1) | valor;
bits_paquete++;

}


////////////////////////////////////////////////////////////////////////////
void procesar_paquete(){
buffer.put(bits_paquete);
buffer.putLong(paquete);
paquete=0L;
bits_paquete=0;

}


////////////////////////////////////////////////////////////////////////////
void setup() {
  buffer.init(20);
  buffer.clear();
 
  pinMode(DATA, INPUT);
  pinMode(13, OUTPUT);
  digitalWrite(13,LOW);
  pinMode(12, OUTPUT);
  PCintPort::attachInterrupt(DATA, &cambio, CHANGE);
  Serial.begin(115200);
  Serial.println("---------------------------------------");
}

/////////////////////////////////////////////////////////////////////////////////////
void mostrar_dato(unsigned long p){
float temp;
bool bot;
byte canal=0;
byte a;
word b;
byte c;
Serial.print("datos:");
Serial.println(p,BIN);
/*
4 bits  ???? (va variando)

8 bits ? (fijo)

12 bits temperatura en celsius
2 bits canal
2 bits ?? (fijo)
*/


a=(p & 0b1110000000000000000000000000) >> 25;
b=(p & 0b0000111111110000000000000000) >> 16;
a=(p & 0b0000000000000000000000000011);

bot=(p & 0b0001000000000000000000000000 !=0);

temp=(0.0+((p & 0b0000000000001111111111110000) >> 4)) /10;
if (temp>204.8) temp-=409.6;

canal=(p & 0b0000000000000000000000001100) >> 2;

Serial.print("temp:");
Serial.println(temp);

Serial.print("boton:");
Serial.println(bot);

Serial.print("canal:");
Serial.println(canal);


Serial.print(a,BIN);
Serial.print(" ");
Serial.print(b,HEX);
Serial.print(" ");
Serial.println(c,BIN);


}



/////////////////////////////////////////////////////////////////////////////////////
unsigned long p;
unsigned long ant=0;
unsigned long rep=0;
unsigned long tiempo=0,m=0;
byte l;
byte estado=0;

void loop() {
 
if (buffer.getSize()>4){

   l=buffer.get(); 
   p=buffer.getLong();
   
   if (l==28){
       tiempo=millis()-m;
       m=millis();
       if (estado==0){ //esperando repeticiones
          if(ant==p) rep++;
          else rep=0;
         
          if (rep>4) {
             estado=1;

             mostrar_dato(p);
             }
          }
       else if(estado==1){ //al menos 4 repeticiones
          if(ant!=p || tiempo>1000) estado=0;//ya no se repite
          }
       ant=p;

       }  //l==28
   }//buffer con datos

}
25  Using Arduino / Installation & Troubleshooting / Re: Problems with 1.x (at least under Linux) on: August 17, 2012, 08:11:55 am
This does not work for you on v1.0.1?
Code:
void setup() {
  Serial.begin(9600);
  Serial.println("setup complete");
}

void loop() {
  Serial.println("tick");
  delay(1000);
}



I just installed 1.0.1, uploaded this and worked ok. Then uploaded ascii table and worked, and uploaded the program that uses the display and it works.

Really I don't know what happened. Sorry for boring with this.
26  Using Arduino / Installation & Troubleshooting / Re: Problems with 1.x (at least under Linux) on: August 17, 2012, 07:56:33 am
IDE v1.0.1 is working great for me in Ubuntu v11.10 and v12.04 with a Mega 2560. I noticed there have been a few format and data type changes when porting from v0022 to v1.0.1.
I understand there are some changes, but the samples should work!, and the serial port is basic.

What is "not working" about Serial.println()? Not compiling? Not running? Not printing anything on the serial output?

The problem compiles and uploads OK but I am not receiving anything thrugh the serial port (usb). The same program compiled with 0022 works ok.

My program started when I tried to get working this display: http://dx.com/p/jy-mcu-16x-digital-tube-yellow-led-module-104311?utm_rid=68099021&utm_source=affiliate with this library:http://code.google.com/p/tm1638-library/ that claims it is compatible with Arduino 1.0 since many versions.

When uploaded the small sample program included with the library I found random leds displayed, then I tried to debug the app inserting some Serial.println, but I received nothing in the serial monitor. Then I inserted a Serial.println at setup function and when it didn't work (sent nothing, no tx/rx leds blinking, etc.). Then I tried uploading the ascii table example of Arduino IDE and it sent nothing through serial port.

My next step was installing Arduino 0022 and all the programa (ascii table and display library worked well).

I must say that some months ago, I had similar problems with Arduino 1.0 and Arduino ISP (it only worked with Arduino 0022).
27  Using Arduino / Installation & Troubleshooting / Re: DIY Arduino problem on: August 17, 2012, 07:35:54 am
The minimum is just the cap for power supply ? Then how can I use the internal oscillator ? What setting should I change ?

For avoiding the crystal, you should program the atmega as 8Mhz internal oscilator. Select arduino pro mino 8Mhz in arduino IDE as target board in order to obtain the right times.
28  Using Arduino / Installation & Troubleshooting / [SOLVED] Problems with 1.x (at least under Linux) on: August 17, 2012, 07:25:38 am
I am having problems with binaries generated by arduino 1.x
The blink test works OK but some programs that worked in arduino 0.x does not work. The more serious problem is that Serial.println does not work in my arduino mega 1280.

I am using the same compiler for both verions of Arduino (0.22 and 1.0.1) (cross-avr-binutils-2.20-1, avrdude-5.11.1-1, cross-avr-gcc-c++-4.6.2-1, avr-gdb-7.1-3, cross-avr-gcc-4.6.2-1).

I understand there may be some differences between 0.x and 1.x and some programs may not work, the ascii chart sample should work!! There must be a problem in my system but if 0.22 works ok, what can be going wrong?

EDIT: The program compiles and uploads OK but nothing is sent to serial port and tx/rx leds does not blink.

29  Using Arduino / Programming Questions / Re: Changing clock speed on: January 28, 2012, 07:41:50 am
Be aware that the internal oscillator might not be accurate enough for the bootloader's serial communications to work correctly (or so I've heard)

If you are programming using ICSP this isn't an issue (although its a little complicated (and slow) to upload sketches via ICSP).

Up to now, the few uploads I made worked OK.
30  Using Arduino / Programming Questions / Changing clock speed on: January 28, 2012, 04:39:28 am
I am building a project whch does not need much speed or accurate. Then I decided to avoid the use of the crystal and program the atmega with 8Mhz internal oscilator.

In order to use the same program as with a normal arduino, I only programmed the fuses and bootloader as indicated in the arduino to breadboard tutorial, but added the board definition to the list of Arduino, in order to continue using the normal pin names.

My problem is that the compiler seems to asume the clock speed is 16Mhz because the times are double of the programmed. Un the data I added, I indicated "atmega328bb.build.f_cpu=8000000L".

¿Is there anything more that I need change or the libraries are made only for 16Mhz?



The section I added is this:

Code:
atmega328.name=Arduino ATmega328 8 MHz internal clock

atmega328.upload.protocol=arduino
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.bootloader.unlock_bits=0x3F

atmega328.bootloader.path=atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex

atmega328.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328.build.core=arduino
atmega328.build.variant=standard
Pages: 1 [2] 3 4 5