Medsimo

Members
  • Content count

    35
  • Joined

  • Last visited

About Medsimo

  • Rank
    Advanced Member
  • Birthday 03/31/1991

Profile Information

  • Gender
    Not Telling
  • Location
    Spain

Recent Profile Visitors

337 profile views
  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 ?
  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. hello !! Everything in order, it works. now what I need to know is, can I send float type data? If so, how?
  4. 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.
  5. any help please ? urgent !! regards.
  6. Rei Vilo what i need is generate random numbers between {1839765.71, 1839765.79} but with float variable ... how can I get it ?
  7. 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); }
  8. 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); }
  9. Hello Guys !! how can i get random numbers between (e.g : {1839765.71, 1839765.79}) ... But only move the last digit (from 1 to 8). thanks !! regards . MR
  10. 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 ?
  11. Thank you very much for your important answers, admin med-Simo
  12. 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 ?
  13. 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
  14. @spirilis helloo !! can you give me insteructions for read (data pins) with my Phone (NFC), how to write RF430BP with this data and read them in my phone. I'm using TM4C123GH6PM. helps please !! regardas. Insert other media