Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Difference Between Compil on Windows or Linux on: October 03, 2012, 04:13:10 pm
Well done,
Thx a lot
2  Using Arduino / Programming Questions / Difference Between Compil on Windows or Linux on: October 03, 2012, 03:54:33 pm
Hi everyone,

I'm playing with SHT21 sensors and a library found on Github (https://github.com/misenso/SHT2x-Arduino-Library),
 and I found a strange issue. It works pretty well if I try it on windows 7 pro 64bit and then if boot and try it on linux (ubuntu 12.04 64bit), it compile, upload but results are odd:

Humidity(%RH): -5.82     Temperature(C): -46.84
Humidity(%RH): -5.79     Temperature(C): -46.85
Humidity(%RH): -5.79     Temperature(C): -46.85
Humidity(%RH): -5.79     Temperature(C): -46.17
Humidity(%RH): -5.82     Temperature(C): -46.17
Humidity(%RH): -5.82     Temperature(C): -46.17

I'm trying to understand why by looking the source code of library but need some clue... (endian issue?)

So what difference(s) between compil on ubuntu and linux?
3  Using Arduino / Programming Questions / Re: Define new varibale type in pgmspace for PROGMEM : structure in FLASH on: May 04, 2012, 05:21:24 am
Nice,
Then I will find a way to do it.

TY.
4  Using Arduino / Programming Questions / Define new varibale type in pgmspace for PROGMEM : structure in FLASH on: May 04, 2012, 04:46:16 am
Hi everyone,
In the PROGMEM documentation we can read :
PROGMEM keyword is a variable modifier, it should be used only with the datatypes defined in pgmspace.h.

So we can use: void, char, unsigned char, int8_t, uint8_t int16_t uint16_t, int32_t, uint32_t, int64_t, uint64_t.

My project start to be bigger and bigger, MenuBackend (without storing strings in FLASH) use quite a lot of SRAM.
I'm thinking of adapt it to use more FLASH memory or even program new menulib management.

The main question is can I define new variable type in pgmspace.h/.c, for exemple structure ?
My programming skill should be enough to do it, but without debugger and such, if its don't works, I won't be sure if its a weird bug or my fault ...
Did anyone (meaning someone who know is stuff ...) ever try to declared struct in pgmspace to store const struct item  in FLASH?
5  Using Arduino / Programming Questions / Re: Printing in landscape through ethernet shield on port 9100 on: April 08, 2011, 02:35:16 am
Thanks for answering but unfortunately it doesn' t work. Anyway that the first time the printer don't print the code.

It prints : "ello Word"

with the write() or print()
println() just print "Hello Word" but still in portrait mode at least the printer seem to read something

I will try some other combinaison but other ideas are welcome
6  Using Arduino / Programming Questions / Re: Printing in landscape through ethernet shield on port 9100 on: April 07, 2011, 07:20:26 am
I have try different way with differents representation but my main problem is how to give parameters to printer.
The xxx.print() , xxx.println() and xxx.write() are just print like other text.

The printer didn't interpret the code, it just print it out.

Any clue for me ?
7  Using Arduino / Programming Questions / Re: Printing in landscape through ethernet shield on port 9100 on: April 07, 2011, 05:06:24 am
All the code is based the pachatube tutorial and on someone's else work found on the net  but i didn't note whom and where... sorry for that

I just post here the code for printing something over 9100 port. My full  program is useless for people I think.



/!\ you need  PCL 5E compatible printer or something like that ( Meaning printer which use proprietary protocol should not work)




/*****************************************************************************************/
/*              test                                                                     */
/*      mac de la carte    byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xXX, 0xXX };          */
/* */
/* */
/*****************************************************************************************/


#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xXX, 0xXX };
byte ip[] = { 192, 168, 1, XXX }; // IP of our arduino
byte server[] = { 192, 168, 1, YYY}; // IP of our printer

Client client(server, 9100);

long lastConnectionTime = 0;       
boolean lastConnected = false;     
const int postingInterval = 30000; 




void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  delay(1000);

 
 
 
 
void loop()
{
 
  // if there's incoming data from the net connection.
  // send it out the serial port.  This is for debugging
  // purposes only:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if there's no net connection, but there was one last time
  // through the loop, then stop the client:
  if (!client.connected() && lastConnected) {
      client.stop();
  }
 
 
   // if you're not connected, and ten seconds have passed since
  // your last connection, then connect again and send data:
  if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {
    sendData();
  }
  // store the state of the connection for next time through
  // the loop:
  lastConnected = client.connected();
}




void sendData() {
    // if there's a successful connection:
    if (client.connect()) {
    Serial.println("connecting...");
    client.println("Hello Word");
    client.stop();
    // note the time that the connection was made:
    lastConnectionTime = millis();
  }
 
 
  else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
    client.stop();
  }

}
8  Using Arduino / Programming Questions / Re: Multiple leds on button command on: April 07, 2011, 03:22:05 am
If you put an ";" at the end of a an If instruction line it "close" the if else structure. So in your code, the Else is not link to the previous if.
9  Using Arduino / Programming Questions / Re: Multiple leds on button command on: April 07, 2011, 03:18:55 am
The opening bracket is in wrong place :

if (buttonState == HIGH){

digitalWrite(ledPin, HIGH);
delay (1000);
digitalWrite(ledPin2, HIGH);
delay (1000);
}
 else {
 
delay(10000);

digitalWrite(ledPin, LOW);
digitalWrite(ledPin2, LOW);
 }

}


instead of



if (buttonState == HIGH);

digitalWrite(ledPin, HIGH); {
delay (1000);
digitalWrite(ledPin2, HIGH);
delay (1000);
}
 else {
 
delay(10000);

digitalWrite(ledPin, LOW);
digitalWrite(ledPin2, LOW);
 }

}
10  Using Arduino / Programming Questions / Printing in landscape through ethernet shield on port 9100 on: April 07, 2011, 03:06:09 am
Hi everyone,

I'm using a Arduino mega with a modified ethernet shield to send data to a printer (actually through a Jetdirect module)...

It's working quite fine except i didn't find the way to setup the printer an print in landscape instead of portrait.

Is anyone had an idea about it ?

Thanks
11  Forum 2005-2010 (read only) / Troubleshooting / Re: avrdude: stk500_getsync(): not in sync: resp=0x00 on: August 16, 2010, 03:11:26 am
Same probleme for me with atmega328 on breadboard with the FT232RL USB to Serial Breakout Board.

As said before pushing reset button just after the "Binary sketch size" message solved the problem

See you
Pages: [1]