Giter Site home page Giter Site logo

arduino-easytransfer's People

Contributors

ademuri avatar j54n1n avatar kumy avatar madsci1016 avatar palatis avatar paulstoffregen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-easytransfer's Issues

Can Send Array of struct(of Strings) using ET ?

Hi Madsci1016
Thanks for your work ¡¡. I have a problem using your lib. The question is: I can transfert array of struct (strings content)between arduinos with softserial ? I using this code:

TX Arduino1:

struct SEND_DATA_STRUCTURE
{
String Nombre;
String RfidTagIDNombre;
String carril;
String Coche;
String RfidTagIDCoche;
};

SEND_DATA_STRUCTURE Piloto[6];

Output log:
dentro del parser 5
Nombre:oskar
Coche:Mitsu
Carril:1
RfidTagIDCoche:f48cc7be
RfidTagIDNombre:cd4941f4

*RX Arduino2:
*

struct RECEIVE_DATA_STRUCTURE
{
String Nombre;
String RfidTagIDNombre;
String carril;
String Coche;
String RfidTagIDCoche;
};

RECEIVE_DATA_STRUCTURE Piloto[6];

void serialEventArdus() {
if(ET.receiveData()){
Serial.print("Nombre:"); Serial.println(Piloto[0].Nombre);

}

Output log:

Nombre:¸¸¸¸¸

A lot of thanks

Examples of EasyTransfer wouldn't work for Arduino Leonardo

As Serial1 is the hardware serial in Leonardo, while in examples Serial is used, it generates an error:

error: no matching function for call to 'EasyTransfer::begin(byte_, unsigned int, Serial__)'
candidates are: void EasyTransfer::begin(uint8_t_, uint8_t, HardwareSerial_)

There can be a line of comment instructing people to switch to Serial1 if they're using Leonardo

Struct Packing

It seems to me that this library is only portable if both the sender and receiver are on the same platform. To serialize a struct, the library is using memcpy(), which does not take into account how different platforms might pack the struct differently.

I'm not sure if this problem would exist between different Arduino boards, such as the Due (ARM) or the UNO (AVR), but perhaps you should at least warn people of this potential.

failed to find document avr/io.h

Oh,hello.I followed the guidance to put SoftEasyTranfer.h in the libraries,but the Arduino IDE couldn't find the avr/io.h when I compiled my project.What's the problem?Could you give me some advices?

Can slave of i2c send data to master?

Hi all,
i would like to use i2c to send data from a slave to master, how can I achieve that,
I read that using wire request can solve those problem . However I dont know how to use that with easy transfer

Uno to Nano 328p

Examples for Hardware serial don't work between nano and uno.

The data i'm gettin back on serial Monitor is ? ? ? ? ? ? ? ? ? . Baud is 9600 in Sketch and so is in Serial Monitor for both boards. Any ideas why?

Data Transfer between arduino and Sensor using LabView Commands problem

I want to do two way communication between labview and arduino. For that I am using easy transfer Library which is really helpful. This library work like polling mechanism for eg: if there is any received data then send it.

I am able to communicate arduino with switch and sensor only when I comment the Send_SensorData function in loop. When I am uncommenting it it does not receive anydata. I don't know what is the problem. Is there any clock issue between arduino and sensor.

Here is the snippet of my code`
//create two objects
EasyTransfer Msgin, Msgout;

//give a name to the group of data
RECEIVE_DATA_STRUCTURE rxdata;
SEND_DATA_STRUCTURE txdata;

static long CycleTime = 10;
static boolean rgb_state = true;
static unsigned long start_time;

void loop() {

if (Msgin.receiveData()) {

// Start only once to start cycle time
if (rxdata.command == RGB_Sensor_Cycle_Time) {
CycleTime = rxdata.data;

}

Send_SensorData(); // Uncomment: command will not be received from LV and if commented reception of command.
}

void Send_SensorData() {

uint16_t red, green, blue, c;
unsigned long current_time;
unsigned long elapsed_time;

current_time = millis();
elapsed_time = current_time - start_time;

if (elapsed_time >= CycleTime && rgb_state == true ) { //&& rgb_state == false

for (int current_sensor_number = 0 ; current_sensor_number < 1; current_sensor_number++) {

  //Read Data for Sensors 0-7
  tcaselect(current_sensor_number);
  tcs.getRawData(&red, &green, &blue, &c);
  txdata.data1 = map(red, 0, 800, 0, 255),
  txdata.data2 = map(green, 0, 800, 0, 255);
  txdata.data3 = map(blue, 0, 800, 0, 255);
  Msgout.sendData();
// rgb_state = false;
}
start_time = current_time;

}
}
`

Connecting Teensy 3.2 together using RS485 / Easy transfer Library

Hi guys

I am new to this library and although I have used C language at lower levels, I would definitely rank myself as a rookie. I am quick to learn though..
I am trying to understand how this library works so that I can communicate between two Teensy 3.2. I have 1 master and 1 slave with a view for 1 master and 2+slaves later on.
I have read the piece from Bill Porter(http://www.billporter.info/2011/05/30/easytransfer-arduino-library/) and a few others too.
I know this is quite a long post with a lot of questions, but I would appreciate the help given.

At the moment I am set up as shown in this post on pjrc (https://forum.pjrc.com/threads/35616-Connecting-2-or-more-Teensy-together-with-RS485) and also the code too. I have attached a potentiometer to pin 14 too.

The questions I have revolve around how the library is constructed and what I can do with it.

So in the example that is set up (EasyTransfer_2Way_wPot_Example), the first that is done is to create two Objects. My understanding is that Objects save values of some sort. But what do the examples of ETIn and ETOut actually do? What is the purpose of having them there?

We then move onto struct RECEIVE_DATA_STRUCTURE and struct SEND_DATA_STRUCTURE
I understand that the struct function creates a structure/record that you can call upon (http://www.tutorialspoint.com/cprogramming/c_structures.htm)
What is the purpose of struct in the example? Is it not possible to just create a variable normally? Or a definition?
The final point on the struct bit, the purpose of naming the data structures rxdata & txdata is to recall that structure when rxdata & txdata are used in the future right?

In the void setup, we have the lines:

  ETin.begin(details(rxdata), &Serial);
  ETout.begin(details(txdata), &Serial);

Is there a specific syntax that is being followed here, as in what is this saying? To my understanding it is saying:
For the values saved as ETIn[I dont know what details does] follow the structure set up above in rxdata and assign this to Serial
and the same for the tx data too.

In the void loop, we have the lines:
txdata.servoval = analogRead(0);
I am just trying to get my head around this, does this say, select the structure called txdata and then from there choose servoval and make servoval equal to analogRead. Or is is saying make txdata.servoval equal to analogRead?

  if(!digitalRead(12))
    txdata.buttonstate = HIGH;
  else
    txdata.buttonstate = LOW;

If not read anything from pin 12, then buttonstate is high, but if you can it is low? is that right?

then the final few bits:

ETout.sendData();
What data is being sent out here? This is the master sending to the slave right?

ETin.receiveData();
Same questions as out, what is being received here? This is the master receiving from the slave?

Many, many thanks if you can help here. I apprentice this is a mix of C programming questions and also library questions, but I really am keen to know what is going on so I can crack ahead with what I am looking to do.

Tej

Bidirectional data sharing? really need this for my project...

EasyTransfer I2C is great and I have been using it successfully with master transferring data to slave. However I have recently had to shuffle functions around between duinos in my project and it's no longer possible to have one I2C master in possession of all relevant data; the slaves now are reading sensors of their own and should report some data back to the master, as well as receiving data from the master.

I was hoping that there was a (master) function ET.requestData(I2C_SLAVE_ADDRESS) but alas it does not seem to exist yet. I had hoped that I could define the shared data struct, write certain values at the slave end, request the struct from the slave, read it on the master, write certain other value at the master end, send it to the slave, and so on. Having the master drive the timing of this conversation is fine, I don't need the slaves to initiate any events.

Is it possible (please) to do this? I am not an advanced Arduino hacker or a very gifted C programmer, but if I had a bit of sample code I could definitely adapt it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.