Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 19, 2014, 07:10:05 am
Thanks for the help, the code is working! Sorry for the misunderstandings
2  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 18, 2014, 12:47:56 pm
This is absurd and irrational.

THAT'S WHAT IS HAPPENING HERE:

You go to the doctor and say, please cure me.
Doctor says "what is wrong"?
You SAY "I have a blide eye, and also my fingher hurts, but just some time, notthing special "
Doctor says "REALLY YOUR FINGHER HURTS? "
You shout "Ehmm...yes doctor but really i just need to know what's wrong with my eye"?
Doctor says "So...tell me about your fingher..."
You shout "Maybe later ok, i promise i will! But something for my eye? If you are not specialized i can go somewhere else ok?
Doctor SHOUT  "HOW DARE YOU DONT TELL ME WHAT'S WRONG WITH YOUR FINGHER????? HOW I AM SUPPOSE TO HELP YOU!!! "

Rationality, something you need to go for coding.  That's why gammon library is not working at  ALL!

and this is not a problem, as a community wy should solve problem together, but the problem here is that i'm asking for something and you are replying totaly offtopic.

I DONT KNOW, sometimes is way the best answer.
3  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 18, 2014, 08:21:34 am
Omg, unbelievable Let's say the ERW problem was my fault ok? HEIII now is working, FINALYY ! Stop talking about it please. YOU ARE OFFTOPIC.


NOW!

Is intended not to send more than 640 long ?  Could you please FOCUS ON THIS?

Or could you just tell us you dont know what is happening instead on focusing on the ERW  , that is in topic as Global Warming, Chemtrails and Diseases?

4  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 18, 2014, 06:13:56 am
I would really love the library to work as intended instead of focusing on the ERW problem. I think is your interset too, to debug something you wrote wich is not working. I just cant get the error, i'm not that skilled programmer.
5  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 17, 2014, 08:33:05 pm
I used this code from gammon library

I2C  everything

http://www.gammon.com.au/forum/?id=10896&reply=8#reply8


MASTER ARDUINO UNO
Code:
// Written by Nick Gammon
// May 2012

#include <Wire.h>
#include <I2C_Anything.h>

const byte SLAVE_ADDRESS = 42;

void setup()
{
  Wire.begin ();
}  // end of setup

void loop()
{

 long foo = 42;
 
 for (float fnum = 1; fnum <= 10; fnum += 0.015)
    { 
    Wire.beginTransmission (SLAVE_ADDRESS);
    I2C_writeAnything (fnum);
    I2C_writeAnything (foo++);
    Wire.endTransmission ();
     
    delay (200);
    }  // end of for

SALVE ARDUINO NANO

Code:
// Written by Nick Gammon
// May 2012

#include <Wire.h>
#include <I2C_Anything.h>

const byte MY_ADDRESS = 42;

void setup()
{
  Wire.begin (MY_ADDRESS);
  Serial.begin (115200);
  Wire.onReceive (receiveEvent);
}  // end of setup

volatile boolean haveData = false;
volatile float fnum;
volatile long foo;

void loop()
{
  if (haveData)
    {
    Serial.print ("Received fnum = ");
    Serial.println (fnum); 
    Serial.print ("Received foo = ");
    Serial.println (foo); 
    haveData = false; 
    }  // end if haveData

}  // end of loop

// called by interrupt service routine when incoming data arrives
void receiveEvent (int howMany)
 {
 if (howMany >= (sizeof fnum) + (sizeof foo))
   {
   I2C_readAnything (fnum);   
   I2C_readAnything (foo);   
   haveData = true;     
   }  // end if have enough data
 }  // end of receiveEvent


foo value 0 to 640 +-

I need 10.000 and more.


When i copypaste I2C Everything on ERW IDE the IDE crashes, works with normal IDE.
6  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 17, 2014, 06:19:41 am
It's not mine, it's the code of the example.
7  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 17, 2014, 04:56:06 am
It arrives at 64x and restart all over. I need to send a > 10.000 integer
8  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 17, 2014, 04:18:18 am
Gammon i dont know why but the library makes me crash the ERW version of the IDE.
I will try and let you know.
9  Using Arduino / Project Guidance / Re: Communicating between Arduino boards using I2C Interface on: September 17, 2014, 04:17:18 am
I'm not that expert, but i dont think eprom is what you are looking for.
I think you should follow wire.h examples. They are quite straight forward.
10  Using Arduino / Programming Questions / Re: Send integer get 256. Arduino I2C comunication on: September 17, 2014, 03:47:55 am
tmd3 it's a  sample code 


I will check Gammon
11  Using Arduino / Programming Questions / Send integer get 256. Arduino I2C comunication on: September 16, 2014, 09:32:46 pm
As i said, i'm sending via SCL SDA a value from an arduino to another.

The data is integer, is sent as integer, is received as integer, but it seems to be bytes.
What i have to do to make a conversion?




MASTER
( sample code )
Code:
#include <Wire.h>
int val=1234;

void setup(){
  Wire.begin(); // Start I2C Bus as Master
Serial.begin(9600);
}

void loop() {


  Wire.beginTransmission(9); // transmit to device #9
  Wire.write(val);              // sends x
  Wire.endTransmission();    // stop transmitting



}




SLAVE
( sample code )
Code:
#include <Wire.h>
int x; ( i cant edit int ) ;
void setup()
{  

   Wire.begin(9);                // Start I2C Bus as a Slave (Device Number 9)
  Wire.onReceive(receiveEvent); // register event

}

void loop()
{


"Print on a LCD x" ,
"x is 0 to 256"



}


void receiveEvent(int howMany) {
  x = Wire.read();    // receive byte as an integer
}

I need the pure data in the other arduino.
12  Using Arduino / Installation & Troubleshooting / Re: Uploading to Mega 2560 works in old software but not 1.0 on: April 17, 2013, 11:02:17 am
I found out that is not a problem of "size" is a problem of something inside the sketch. I tried to upload a previous version and it's uploading, then i "pumped" the size of the sketch and it's uploading fine.

At this point , what's the difference between Arduino Mega 1280 and Mega 2560? I think the sketch is calling a variable or some stuff like that,  that makes the upload stop.
13  Using Arduino / Installation & Troubleshooting / Re: Uploading to Mega 2560 works in old software but not 1.0 on: January 29, 2013, 11:41:56 pm
any news?
14  Using Arduino / Project Guidance / Re: EMP Electro Magnetic Pulse gun / device on: January 29, 2013, 11:17:51 pm
In mine, is not illegal. I want to make just a small electromagnetic jammer. I dont think you would die due to 30volt smiley
15  Using Arduino / Installation & Troubleshooting / Re: Uploading to Mega 2560 works in old software but not 1.0 on: January 26, 2013, 10:07:30 pm
still not working for me...
Pages: [1] 2 3 ... 5