Show Posts
Pages: [1] 2 3 ... 8
1  Using Arduino / Displays / Re: U8GLIB and bitmap creation/display on: March 02, 2013, 06:39:25 pm

Thank you again for your support.
I'll test my sketch with and without PROGMEM to look which one seems more stable.

Bye!

Simon
2  Using Arduino / Displays / Re: U8GLIB and bitmap creation/display on: March 02, 2013, 04:45:01 pm

Try this:
- Replace "static" with "const" or
- Remove "static" or
- Add "const"

Oliver


This works!
Could you explain me why or point me where to read about it?

Code:
const unsigned char cocktail_bits[] U8G_PROGMEM

Thank you a lot!

The only strange behaviour is that in PROGMEM doesn't always draw/react well... smiley-sad



Have a nice one!

Simon
3  Using Arduino / Displays / Re: U8GLIB and bitmap creation/display on: March 02, 2013, 12:15:50 pm
You could try PROGMEM instead of U8G_PROGMEM.

Methods to move data from RAM to FLASHROM do not work that well with the g++ compiler (the one used by Arduino IDE).
Additionally behavior has changed during versions of g++.
U8G_PROGMEM is a little bit different to PROGMEM and was optimized for the gcc compiler. Maybe this has caused the problem.

Oliver

Same error:

Code:
static unsigned char cocktail_bits[] PROGMEM = {

Code:
error: cocktail_bits causes a section type conflict

smiley-sad
4  Using Arduino / Displays / Re: U8GLIB and bitmap creation/display on: March 02, 2013, 06:50:09 am

Thank you a lot, it works well on the example.
I've only a little problem. If I move the example in my sketch, I obtain this error:

Code:
error: cocktail_bits causes a section type conflict

I need to remove the 'U8G_PROGMEM' statement from 'cocktail_bits' definition and draw with 'u8g.drawXBM' instead of 'u8g.drawXBMP'.

I'm using other includes, maybe conflict?

Code:
#include <SPI.h>
#include <avr/pgmspace.h>
#include "printf.h"
#include <RF24Network.h>
#include <RF24.h>
#include "nodeconfig.h"
#include <OneWire.h>
#include <DallasTemperature.h>


Why?

TY!

Simon
5  Using Arduino / Displays / U8GLIB and bitmap creation/display on: March 01, 2013, 01:59:34 pm

Hello!

I've succesfully setup a ST7920 using the u8glib library. Now I would like to display a small image. The bitmap.pde example taken from the library works well. It draws a little castle, like this:



I've found this software that should allow me to convert an image to hex:

http://arduino.cc/forum/index.php?PHPSESSID=da51b3d533674b70603c5d0222f709f9&topic=114802.0

Start with an example, the file in attach is a small png in monochrome.

This, imported in the software, converted to hex, gives me as result:

Code:
0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x1,0xff,0xc0,0x0,0x0,0x0,0x7,0xff,0xe0,0x0,0x0,0x0,0xf,0xff,0xf0,0x0,0x0,0x0,0x1f,0xff,0xf8,0x0,0x0,0x0,0x3f,0xc3,0xfc,0x0,0x0,0x0,0x7f,0x0,0xfe,0x0,0x0,0x0,0x7e,0x0,0x7e,
0x0,0x0,0x0,0x7c,0x0,0x3e,0x0,0x0,0x0,0xfc,0x0,0x1f,0x0,0x0,0x0,0xf8,0x0,0x1f,0x7f,0xff,0xff,0xff,0xf0,0x1f,0xff,0xff,0xff,0xff,0xf8,0x1f,0xff,0xff,0xff,0xff,0xf8,0x1f,0x7f,0xff,0xff,0xff,0xf0,0x1f,0x3f,0xff,0xff,0xff,0xe0,0x3e,
0x1f,0xff,0xff,0xff,0xc0,0x7e,0xf,0xff,0xff,0xff,0x80,0xfe,0x7,0xff,0xff,0xff,0xc3,0xfc,0x3,0xff,0xff,0xff,0xff,0xf8,0x1,0xff,0xff,0xff,0xff,0xf0,0x0,0xff,0xff,0xff,0xff,0xe0,0x0,0x7f,0xff,0xf3,0xff,0xc0,0x0,0x3f,0xff,0xe0,0x7e,0x0,
0x0,0x1f,0xff,0xc0,0x0,0x0,0x0,0xf,0xff,0x80,0x0,0x0,0x0,0x7,0xff,0x0,0x0,0x0,0x0,0x3,0xfe,0x0,0x0,0x0,0x0,0x3,0xfe,0x0,0x0,0x0,0x0,0x1,0xfc,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,
0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,
0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x1,0xfc,0x0,0x0,0x0,0x1,0xff,0xff,0xfc,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x1,0xff,0xff,0xfc,0x0,0x0

And here the complete skatch I'm using, starting from the 'bitmap.pde' example contained in the library:

Code:

#include "U8glib.h"

U8GLIB_ST7920_128X64 u8g(7, 6, 5, U8G_PIN_NONE);

const uint8_t cocktail[] PROGMEM = {
 
0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x1,0xff,0xc0,0x0,0x0,0x0,0x7,0xff,0xe0,0x0,0x0,0x0,0xf,0xff,0xf0,0x0,0x0,0x0,0x1f,0xff,0xf8,0x0,0x0,0x0,0x3f,0xc3,0xfc,0x0,0x0,0x0,0x7f,0x0,0xfe,0x0,0x0,0x0,0x7e,0x0,0x7e,
0x0,0x0,0x0,0x7c,0x0,0x3e,0x0,0x0,0x0,0xfc,0x0,0x1f,0x0,0x0,0x0,0xf8,0x0,0x1f,0x7f,0xff,0xff,0xff,0xf0,0x1f,0xff,0xff,0xff,0xff,0xf8,0x1f,0xff,0xff,0xff,0xff,0xf8,0x1f,0x7f,0xff,0xff,0xff,0xf0,0x1f,0x3f,0xff,0xff,0xff,0xe0,0x3e,
0x1f,0xff,0xff,0xff,0xc0,0x7e,0xf,0xff,0xff,0xff,0x80,0xfe,0x7,0xff,0xff,0xff,0xc3,0xfc,0x3,0xff,0xff,0xff,0xff,0xf8,0x1,0xff,0xff,0xff,0xff,0xf0,0x0,0xff,0xff,0xff,0xff,0xe0,0x0,0x7f,0xff,0xf3,0xff,0xc0,0x0,0x3f,0xff,0xe0,0x7e,0x0,
0x0,0x1f,0xff,0xc0,0x0,0x0,0x0,0xf,0xff,0x80,0x0,0x0,0x0,0x7,0xff,0x0,0x0,0x0,0x0,0x3,0xfe,0x0,0x0,0x0,0x0,0x3,0xfe,0x0,0x0,0x0,0x0,0x1,0xfc,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,
0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,
0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x0,0x0,0x0,0x1,0xfc,0x0,0x0,0x0,0x1,0xff,0xff,0xfc,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x3,0xff,0xff,0xfe,0x0,0x0,0x1,0xff,0xff,0xfc,0x0,0x0
 
};


void draw(void) {
  // graphic commands to redraw the complete screen should be placed here 
  u8g.drawBitmapP( 20, 20, 1, 20, cocktail);
}

void setup(void) {
}

void loop(void) {
  // picture loop
  u8g.firstPage(); 
  do {
    draw();
  } while( u8g.nextPage() );
 
  // rebuild the picture after some delay
  delay(1000);
}


I haven't understood well how the draw syntax works, even if I've read the doc...

u8g.drawBitmapP( 20, 20, 1, 20, cocktail);

I'm additionally not sure if the hex is valid.

Could someone help me?

Thank's!

Simon
6  Using Arduino / Programming Questions / Re: Help with RF24Network and nRF24L01+ on: February 28, 2013, 10:37:39 am

meshping.pde from the RF24Network library. It's compliant on what you would like to create following option2.

Let me know smiley

Simon
7  Using Arduino / Programming Questions / Re: Help with RF24Network and nRF24L01+ on: February 28, 2013, 10:19:52 am
Hello!

First of all let me explain in 2 words what I'm trying to do:
Using the maniacbug library and starting from the meshping example I'm having a central node (00) on an arduino 2009 with ethernet shield that collect informations from (actually) two other nodes.
The node 00 can send out messages too. In this way, node00 can collect these informations and, if I send a message via ethernet (web-browser), node00 can forward the msg via radio. On one of them a relayboard gives me the ability to power on/off whatever is connected (actually nothing, eheh).
I'm planning to have the leafes always connected on 220V (->5v), but I'm looking as well to create my own nodes following the documentation to create low power nodes:

Low Power node description @maniacbug's site:
http://maniacbug.wordpress.com/2011/10/19/sensor-node/

Seems the life of those leafes should be great. The radio library has a sleep mode to place the module in standby.

But if you would like to power-down the arduino, having implemented a kind of bi-directional comunication, I could choose to send a message from node00 as well as power-down the radio if the leaf cannot reach the node00.

Option2 would be easier because when you send a message from the leaf to the node00 you have always a boolean return value if it was sent succesfully. Look at the meshping example:

Code:
    // Normal nodes send a 'T' ping
    if ( this_node > 00 || to == 00 )
      ok = send_T(to);
   
    // Base node sends the current active nodes out
    else
      ok = send_N(to);

    // Notify us of the result
    if (ok)
    {
      printf_P(PSTR("%lu: APP Send ok\n\r"),millis());
    }
    else
    {
      printf_P(PSTR("%lu: APP Send failed\n\r"),millis());

####
## YOU COULD INCREASE HERE A COUNTER. IF COUTER > MAX_FAIL, THEN SHUTDOWN.
####

      // Try sending at a different time next time
      last_time_sent -= 100;
    }

Hope it helps!

Simon
8  Using Arduino / Programming Questions / Re: Help with RF24Network and nRF24L01+ on: February 26, 2013, 09:36:20 am
What a shame that you should have to be the one to RTFM. Surely, someone else should have read the f*ing manual for you.

Well, maybe I was misunderstood. I'm really noob with arduino and overall with electronic components... as well as writing in english smiley
I've read the overall documentation of RFNetwork on the Maniacbugs site, many times. There were many points not really understood by me. I've tried to read the datasheet too, but it's really difficult for me to deal with concepts I've never used before. C language is something new too, even if I've programmed with many different languages. (pointers, memory issues, aso.... uh!).
I think Arduino is really a great project to let people like me, who hasn't experience, to join a new world. The forum let us place in contact and help together. That I've not received useful hints to solve my issues in this case is a fact. No bad at all, because there is nowhere written here I can find all answers on my Arduino doubts smiley Most of the time I've found many people helping me, that's great. After some months I went back to Maniacbugs site (library author) and found someone commented about the radio size limit. I've then read another time the datasheet and understood something new that I was not able to understand before. Well, in this way I've token more time but I'm more proud to have found a solution by myself smiley Elementary for most of you, not for me.
Meaning someone else should read the manual for me and answer on my doubts was not my goal. If I ask something is 'cause I was not able to find exactly for an answer and is the reason why someone should ask on the forum.

Hope have clarified better my point of view and repeat my thanks to this great project and the whole community behind. Sorry if I've given another impression about that.

Simon
9  Using Arduino / Programming Questions / Re: Help with RF24Network and nRF24L01+ on: February 26, 2013, 03:42:19 am
Hi Simon, did you ever get his working?

Hello Jimster, I've solved all my issues. Well, it was not easy 'cause I'm a noob and haven't received much support and suggestions. This has forced me to RTFM (library and datasheet) in deep (what should be done almose always) and try-try-try-try.
BTW now I've rewritten some parts of the code and solved.

If you need some help, let me know. I'll try my best to help you. Write here or PM me.

Bye, Simon
10  Using Arduino / Displays / Re: LCD 128x64 ST7920 & NRF24L01+ & DHT11 & Arduino NANO3.0 on: February 13, 2013, 03:46:45 am


Using different pins it works the same way, as suggested. I cannot see big difference in update time, 'cause I'm drawing only some values.
The compiled sketch is a little big, also I'll try the dc42's library as well.

I've learned something new... again smiley-wink

Thank's to all for the support!

Simon
11  Using Arduino / Displays / Re: LCD 128x64 ST7920 & NRF24L01+ & DHT11 & Arduino NANO3.0 on: February 12, 2013, 08:21:37 am
You'll need to check the u8glib documentation to see whether it supports serial mode using pins other than the SPI pins. If it doesn't, then you can find my own ST7920 library at https://github.com/dc42/arduino, but it's not as comprehensive as u8glib and it uses a 1K image buffer (which is half the RAM on an Uno).

The point about the SPI pins is that is uses hardware to do fast serial transfers. However, you can do similar sorts of serial transfer at a slower speed using the shiftOut function (which is very slow) or using direct port manipulation.

Well, I could test your library as well! If smaller, even better!
Reading the ubglib it's written "COM interfaces: Software SPI, Hardware SPI, 8Bit parallel".
But reading the supported devices I cannot understand a part:

https://code.google.com/p/u8glib/wiki/device

Looking for ST7920, There are three ways to control:
SW SPI    u8g_dev_st7920_128x64_sw_spi    U8GLIB_ST7920_128X64(sck, mosi, cs, a0 [, reset])   
HW SPI    u8g_dev_st7920_128x64_hw_spi    U8GLIB_ST7920_128X64(cs, a0 [, reset])   
8 Bit    u8g_dev_st7920_128x64_8bit    U8GLIB_ST7920_128X64(d0, d1, d2, d3, d4, d5, d6, d7, en, cs1, cs2, di, rw [, reset])

8Bit is parallel, ok.
Is SW SPI what I should need? But in case it uses SCK, MOSI that should part of SPI protocol on pins 11+13 already used.... what is then HW SPI? Confused again smiley-sad

BTW I'll test all those solutions, included your version.

Thank's!

Simon
12  Using Arduino / Displays / Re: LCD 128x64 ST7920 & NRF24L01+ & DHT11 & Arduino NANO3.0 on: February 12, 2013, 03:10:04 am
You don't have to use the SPI pins to drive the ST7920 display in serial mode. You can use any 2 pins, although the update speed will be slower than the speed you can get using SPI.

I'm using the U8glib library and to make the display work I use the following setup:

Code:
// SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10
U8GLIB_ST7920_128X64 u8g(13, 11, 10, U8G_PIN_NONE);

You mean I could use any digital pin instead pins 11 and 13 that I've still in use for my NRF24L01+?
Would be great! I need only to print some values, also a fast update speed is not a requirement.

I'll try using this setup:
Code:
U8GLIB_ST7920_128X64 u8g(4, 5, 6, U8G_PIN_NONE);

I cannot try it right now, but let you know in case there is someting that doesn't work as expected.
BTW I've to find some documentation to better understand what exactly are some common concepts like SPI, miso-mosi...
Why, in this case, SPI pins are not required?

Thank's!

Simon
13  Using Arduino / Displays / Solved: LCD 128x64 ST7920 & NRF24L01+ & DHT11 & Arduino NANO3.0 on: February 11, 2013, 03:40:57 pm
Hello to all!

I'm using some Arduinos to send sensor data (Temperature read from DHT11) trought NRF24L01+ antennas. Untile here all works very well.
My setup is like attached image...
Sorry, but cannot draw very well with Fritzing. Consider the upper right device as the NRF24L01+ transceiver.

Then, I was able to wire and work on another Arduino having a ST7920 LCD 128x64 connected in Serial Mode. What I would like to do is to use the LCD on one of the existing Arduinos with the NRF24L01+ antennas but cannot figure out how to wire/setup it.... I'm not sure it's possible... 'cause:

a) the ST7920 in Serial Mode cannot be used; the NRF24L01+ still use the SPI communication also cannot share it
b) the ST7920 in Parallel Mode needs more digital PINS and I haven't enough
c) I've thought to use a TLC5940 to multiply my digital pins but seems it uses SPI as well, also, like point a, I cannot choose this mode.

Is there a way to add on an Arduino NANO all those devices in any way? (also ST7920 + NRF24L01+ + DHT11).

Thank's for the help!

Simon
14  International / Hardware / Re: Controllo relè e verifica stato... on: January 16, 2013, 06:44:52 am
ciao X3fil  e ciao a tutti

Ho letto lo scambio di messaggi che hai avuto per realizzare il controllo relè e il verfica stato.

Siccome anche io devo fare la stessa cosa ti chiedo se poi sei riuscito a realizzarlo e se si con quali componenti e se hai uno schema semplice da postare??

Grazie

Ciao!

Purtroppo non ho avuto più modo di seguire il progetto. Mi sono arenato a monte nel cercare di far funzionare delle schede radio nRF24L01+. Ne sto venendo fuori da poco, quindi poi riprenderò il discorso. Un mio amico sta invece provando alternative simili. Alla fine però ha optato per delle schede relè preconfezionate un po' avanzate. La strada che percorrerò cmq per verificare lo stato del relè è quella consigliata, ovvero trovare dei relè passo passo a doppio stato come indicato da brunello. Si trovano con un po' di difficoltà in più, non proprio economici, ma si trovano.

Simone

15  Using Arduino / Networking, Protocols, and Devices / Re: Help with RF24Network and nRF24L01+ on: January 02, 2013, 01:21:10 pm

Sorry if I bring my thread back up, but I really cannot find a solution to my case.
I really don't know if the library can handle bidirectional messages or if it's a simple issue on my char array that will be overwritten. I've no idea if in some cases same pipe on underlying radio are used for different messages or whatever.

I'm trying/editing this code for weeks with no useful results...

Please, need some help :'(

Simon
Pages: [1] 2 3 ... 8
Powered by SMF 1.1.19 | SMF © 2013, Simple Machines