I2C Read

This node acts as an I2C master, and reads a value sent by another Arduino with an I2C Write node.

Includes

#include "Wire.h"

Decleration Code

void receiveEvent(int howMany)
{
    int x = Wire.read();             // receive byte as an integer
    Output_Activation = transform(x, 0, 255, 0.0, 1.0);
}

Setup Code

Wire.begin(4);
Wire.onReceive(receiveEvent);

No required source files.

To use this node in your Embrio project, either add it from the Library toolbar or copy the XML in the below box and paste it into a node screen.

View Comments (0)