Jump to content
43oh

Medsimo

Members
  • Content Count

    35
  • Joined

  • Last visited

Posts posted by Medsimo

  1. Hello everyone. I've been working with the NFC module, and it worked. It sent data of an application of measures.

    I have connected with the TIVA 123GXL. Today I wanted to read data, And it no longer works. Is there any way to tell if the module does not transfer data?

    I connected an oscilloscope between the pins 14,15 (bridged with 9.10 respectively) of the I2C. and it show 3.2 V  in the following figure.

    some help ?

    1.PNG

  2. my code is : 

     

    #include "NDEF.h"
    #include "NDEF_TXT.h"
    #include <RF430CL.h>
    #include <Wire.h>
    
    
    #define RF430CL330H_BOOSTERPACK_RESET_PIN  8
    #define RF430CL330H_BOOSTERPACK_IRQ_PIN    12
    
    RF430 nfc(RF430CL330H_BOOSTERPACK_RESET_PIN, RF430CL330H_BOOSTERPACK_IRQ_PIN);
    
    double randomDouble(double min, double max, int numCasas){
      long _min = min * pow(10, numCasas) + 0.1; 
      long _max = max * pow(10, numCasas) + 0.1;
      return (double) random(_min, _max) / pow(10, numCasas) ; 
    }       
    
            double Freq = randomDouble(10.71, 10.79, 2)+1839755.00;
            double voltage_1 = randomDouble(0.82, 0.88, 2);
            double temperature = randomDouble(18.30, 20.00, 2);
            double vol = randomDouble(3.10, 3.29, 2);
            
    void setup() {
      Serial.begin(115200);
      delay(1000);
      Serial.println("Initializing I2C and RF430CL330H-");
      Wire.begin();                                                              // Initialize I2C subsystem
      nfc.begin();                                                              // Format RF430CL330H, prepare for data
      attachInterrupt(RF430CL330H_BOOSTERPACK_IRQ_PIN, wake_up, FALLING);      // Register interrupt to wake MCU when RF430CL330H INTO (IRQ) line triggers
    
      Serial.println("Creating NFC NDEF_TXT object-");
       
      String Value = "El valor actual de F_Tiva es de "; 
      Value = Value + (Freq/1000000) + " MHz. El V_Tiva detectado es de " + voltage_1;
      Value = Value + ", la temperatura_Nodo1 es" + temperature + ", el voltaje_Nodo1 es" + vol;
      Value = Value + ", la temperatura_Nodo2 es" + temperature + ", el voltaje_Nodo2 es" + vol + ". El informe de estado del equipo ha terminado. Hasta pronto.";
      
      Serial.println("Posting to RF430CL330H-");
      size_t ndef_size;
    
      ndef_size = Value.sendTo(nfc);                                       // Write NDEF data to NFC device memory
      nfc.setDataLength(ndef_size);                                            // Inform NFC device memory how much data is there
    
      Serial.println("Activating RF430CL330H RF link-");
      nfc.enable();  // Now we're live!
    }
    
    void loop() {
      if (nfc.loop()) {
        if (nfc.wasRead()) {
          Serial.println("Something has read the NFC device!");
        }
        if (nfc.available()) {
          Serial.println("Something has re-written the NFC device!");
          nfc.flush();
        }
        nfc.enable();  // If nfc.loop() returns true, it will have disabled the RF link as a side-effect.
      }
    
      Serial.println("<low power sleep>");
      Serial.flush();  // wait for unsent UART data to flush out before going into low-power sleep
      suspend();  // Enter indefinite sleep (LPM4 on MSP430, DEEPSLEEP on ARM)
      Serial.println("<wake up>");
    }
    
    void wake_up()
    {
      wakeup();  // Signal Energia to wake the MCU upon IRQ exit
    }

    I've errors .... 

    nfc_1.cpp: In function 'void setup()':
    nfc_1.cpp:40:21: error: 'class String' has no member named 'sendTo'
       Value = Value + (Freq/1000000) + " MHz. El V_Tiva detectado es de " + voltage_1;
                         ^

  3. 8 hours ago, Rei Vilo said:

    So unfortunately, don't expect others to do your homework. Instead, they may provide you pointers. 

    See Netiquette for Newbies

    nooooo !!! 

    It's not what I'm looking for, I just need to be guided, I don't want you to do my homework.

     What I usually do is take examples and modify them for my need.

    I mean that I have covered the code provided above, but it does not work for me, so I asked. To know if something I am doing wrong. Then when communication works, I will change things my way.

    thank you for your answer.

    Greetings.

  4. On 13/4/2017 at 5:28 PM, Rei Vilo said:

    Try modulo. 

    
    result = random_number % 10;

     

    I try this example but the reaults is not what i'm looking for .... how can i fix it ? 

    long randNumber;
    float result;
    
    void setup(){
      Serial.begin(115200);
      randomSeed(analogRead(0));
    }
    
    void loop() {
      
      randNumber = random (183976571, 183976579);
      Serial.println(randNumber);
      result = randNumber%10;
      Serial.println(result);
      delay(1000);
    }

     

  5.  

    Hello everyone !!

    I have a small problem and it is the following:

    First I'm simulating sensors with approximate random's values, and I need to upload this data to pubnub and freeboard as monitoring platform, the problem I have is that in pubnub I find the values updated in real time,  What happens, is that when I upload to freeboard are not updated, they take a fixed number.  

    I am hesitating in the way of storing them, I think it is not appropriate.

    I have the well-linked accounts between pubnub and freeboard.

     

    Greetings. MR

    this is my code !! 

     

    #include <SPI.h>
    #include <WiFi.h>
    #include "PubNub.h"
    #include <aJSON.h>
    
    #define NUM_CHANNELS 4  // How many analog channels do you want to read 
    
    double randomDouble(double min, double max, int numCasas){
      long _min = min * pow(10, numCasas) + 0.1;
      long _max = max * pow(10, numCasas) + 0.1;
    
      return (double) random(_min, _max) / pow(10, numCasas) ; 
    }
    
    int sn=0;
    
    char pubkey[] = "***";
    char subkey[] = "***";
    char channel[] ="***";
    char uuid[] =  "***";
    
    // your network name also called SSID
    char ssid[] = "***";
    // your network password
    char password[] = "***";
    static int keyIndex = 0; 
    
    
    void setup()
    {
    
    	Serial.begin(115200);
        randomSeed(analogRead(0));
    	PubNub.begin(pubkey, subkey);
    	PubNub.set_uuid(uuid);
    	Serial.println("PubNub set up");
    }
    
    void loop()
    {
      double Freq = randomDouble(10.71, 10.79, 2)+1839755.00;
      double voltage_1 = randomDouble(0.82, 0.88, 2);
      double temperature = randomDouble(18.30, 20.00, 2);
      double vol = randomDouble(3.10, 3.29, 2);
      
      double data[] = {Freq, voltage_1, temperature, vol};
      
      
    	PubSubClient *client;
     
            // create JSON objects
            aJsonObject *msg, *dataReadings;
            msg = aJson.createObject();
            aJson.addItemToObject(msg, "DataReading", dataReadings = aJson.createObject());
            
            // get latest sensor values then add to JSON message
            for (int i = 0; i < NUM_CHANNELS; i++) {
              String Channel = String(data[i]);
              char charBuf[Channel.length()+1];
              Channel.toCharArray(charBuf, Channel.length()+1);
              double Values = data[i];
              aJson.addNumberToObject(dataReadings, charBuf, Values);
            }
            
            // convert JSON object into char array, then delete JSON object
            char *json_String = aJson.print(msg);
            aJson.deleteItem(msg);
            
            // publish JSON formatted char array to PubNub
    	Serial.print("publishing a message: ");
    	Serial.println(json_String);
            PubNub.publish(channel, json_String);
            free(json_String);
            
    	delay(500);
    }

     

  6. hello admin ..
    I have been looking at the datasheet of TM4C123GH6PM and it states that the maximum clock frequency is 80Mhz. not 120.

    And did not put any of the divisors. they are the same ?

  7. This means that depending on the divider used, the frequency varies, 
    has used 16 bits and the variation has gone from 28.6 hz, up to 60Mhz ...
    
    but the 120 Mhz of the maximum and the minimum of the PWM does not change ?

     

  8. Hello all !!

    I have a question about my TIVA board:

    What is the range of frequencies that we can get for the PWM, taking into account the possibilities of "clock division" and the "number of bits"? I ask you if in case we had to measure a resonator with the PWM as a generator (at 50% duty cycle).

    regards

  9. hello People !! I have traying to upload this code (see below) in Tiva C LP with CC2530 AIR MODULE. I have this errors, someone gives me some help please. " I have libreries in order and all"

    Issues:

    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp: In member function 'void SPIClass::begin()':
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp:207:55: error: invalid conversion from 'long unsigned int*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
      while(ROM_SSIDataGetNonBlocking(SSIBASE, &initialData));
                                                           ^
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp: In member function 'uint8_t SPIClass::transfer(uint8_t)':
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp:244:35: error: invalid conversion from 'long unsigned int*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
      ROM_SSIDataGet(SSIBASE, &rxtxData);

    Tiva_measurment.ino

  10. hello People !! I have traying to upload this code (see below) in Tiva C LP with CC2530 AIR MODULE. I have this errors, someone gives me some help please. " I have libreries in order and all"

    Issues:

    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp: In member function 'void SPIClass::begin()':
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp:207:55: error: invalid conversion from 'long unsigned int*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
      while(ROM_SSIDataGetNonBlocking(SSIBASE, &initialData));
                                                           ^
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp: In member function 'uint8_t SPIClass::transfer(uint8_t)':
    C:\Users\Myriam\Documents\Energia\libraries\SPI\SPI.cpp:244:35: error: invalid conversion from 'long unsigned int*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
      ROM_SSIDataGet(SSIBASE, &rxtxData);
                                       ^

     

    code: 

    Tiva_measurment.ino

  11. Okay, I have something, but I would like to know if these data are correct, because 18 degrees seem exaggerated to me in a room where the maximum is 13 degrees. The voltage does not know if it is good or not.

     

    another question. How could you measure the temperature with the TMP006 of the CC2530 module and send it to the coordinator?

     

     

    for more information: please see https://github.com/mweintra/ZigBee/issues/1.  I have put my doubts there, but mweintra told me  to put them in this forum.

     

     

    https://cloud.githubusercontent.com/assets/23233776/22747556/a8087518-ee27-11e6-9fe7-a0444c27c408.png

     

     

     any help please  ?

    med. 

  12. Okay, I have something, but I would like to know if these data are correct, because 18 degrees seem exaggerated to me in a room where the maximum is 13 degrees. The voltage does not know if it is good or not.

    another question. How could you measure the temperature with the TMP006 of the CC2530 module and send it to the coordinator?

     

     

    for more information: please see https://github.com/mweintra/ZigBee/issues/1.  I have put my doubts there, but mweintra told me  to put them in this forum.

     

     

    https://cloud.githubusercontent.com/assets/23233776/22747556/a8087518-ee27-11e6-9fe7-a0444c27c408.png

     

     

     any help please  :) 

    med. 

    Sensor_End_Device.rar

    Gateway_Coordinator.rar

  13. What LaunchPad are you using? ...................................................................................................... MSP430G2553LP v1.4


    What operating system? ................................................................................................................... Windows 8.1


    Did you install the required drivers according to instructions on http://energia.nu/guide/ ? .............. Yes.


    Can you see a new serial port appear when plugging in the LaunchPad?  ...................................... Yes.


×
×
  • Create New...