Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


materiel:xbee:star:processing-codes

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
materiel:xbee:star:processing-codes [2014/09/18 00:42]
resonance
materiel:xbee:star:processing-codes [2014/09/18 00:43] (Version actuelle)
resonance
Ligne 1: Ligne 1:
 +=====  Receive XBee packets in API mode (basics with serial) =====
 +<code cpp>
 +/*
 + * Receive XBee packets in API mode (basics with serial)
 + * from http://www.pobot.org/XBee-API-pour-pilotage-a-distance.html
 + */
 +import processing.serial.*;
 +import xbee.*;
 +Serial port;
 +
 +void setup()
 +{
 +  println(Serial.list());
 +  port = new Serial(this, Serial.list()[0], 9600);
 +  port.write("+++");
 +  delay(1100);
 +  port.write("ATRE,ID1111,MY1234,DH0,DL0,CN\r\n");
 +}
 +
 +void draw()
 +{
 + while (port.available() != 0) {
 +  String val = hex(port.readChar());
 +  if (val.equals("007E")) {
 +    println();
 +  }
 +  print(val);
 +  print(" ");
 + 
 +}
 +</code>
 +
 ===== Receive XBee packets in API mode with xbee-api ===== ===== Receive XBee packets in API mode with xbee-api =====
  
/home/resonancg/www/wiki/data/attic/materiel/xbee/star/processing-codes.1410993760.txt.gz · Dernière modification: 2014/09/18 00:42 de resonance