Changes between Version 1 and Version 2 of SujetTP8-2016


Ignore:
Timestamp:
Apr 1, 2016, 9:57:43 AM (9 years ago)
Author:
franck
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SujetTP8-2016

    v1 v2  
    44
    55= Connexion Arduino - Arduinos =
     6
     7L'application suivante fait communiquer trois arduinos. Deux sont des capteurs et un est une base.
     8Dans le projet final, la base sera sur le RaspberryPI. Dans l'immédiat pour simplifier la base sera sur l'arduino mais se comptera presque comme la basen, à ceci près que le server http sera simplement le terminal.
     9
     10L'API de commande du module NRF est la même sur Arduino et sur RaspberryPI et c'est grâce à ça qu'il est possible d'envisager de commencer par 100% Arduino avant de faire intervenir le RaspberryPI.
    611
    712{{{#!c
     
    144149
    145150void SendTSC ( byte instance, byte timer, unsigned long period, byte *dest) {
    146   unsigned long TSC[2];
     151  static unsigned long TSC[2];
    147152  if (!waitFor(timer, period)) return;
    148153  radio.openWritingPipe(dest);
     
    181186
    182187void loop() {
     188  byte timer=0;
     189  byte instSendTSC=0;
    183190  BaseRF(&lumi, &lumiFull); 
    184191  Oled1 (&lumi, &lumiFull);
    185   SendTSC (0, 0, 1000000, addresses_tx[0]);
    186   SendTSC (1, 0, 500000,  addresses_tx[1]);
     192  SendTSC (instSendTSC++, timer++, 1000000, addresses_tx[0]);
     193  SendTSC (instSendTSC++, timer++, 500000,  addresses_tx[1]);
    187194}
    188195}}}