[SOLVED] Get data sketch


I am newbie at Blynk and I am using particle Photon, and also newbie with this board.
I do not use the Arduino neither Arduino IDE.
I am trying to figure out how to visualize data form the “Get Data sketch” with no serial terminal like the one included in Arduino IDE.

You use whatever serial monitor the IDE that you do use… uses… :stuck_out_tongue:

Or you could also use any other terminal program… I use termite:

Thank you Gunner

Gunner one more question.
What firmware function should I use for send data to the TX pin of Particle Photon?. That data is gonna be created for a slider widget o Blynk app which is gonna send data to a virtual pin V1.
Thank you for your help.

I’m not familiar with the Particle Photon, why can’t you just send the serial data to Termite using the serial.print() command?

Or if you want to skip the serial monitor, replace the serial.print() command with Blynk.virtualWrite(vPin, pinValue) and send the data right back to the App using a Value Display Widget set to V2

Hi Gunner

Thank you, done!, you helped me to put the bullet on the right target.

I used :

  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable

 Blynk.virtualWrite(V1, pinValue) ;

For me today is a great triumph.:slight_smile:

1 Like

You shouldn’t need this line as the whole function’s data is coming from the Widget with V1 in the first place.

Yes, you are Right !!!.
If you don’t mind I have other question/commentary :
Just for curiosity and tinkering with Blynk I added one second slider to the original one to change bright on a led.
I saw with surprise that for Particle Photon , with 8 DO, just 1 slider get 2 DO .
I added one more slider and only left 4 DO with PWM.
What if I need more slider for a Lighting Control in this case with Photon, should I use Virtual pins ?

Thank you in advance

Based on documentation from here

[3] PWM is available on D0, D1, D2, D3, A4, A5, WKP, RX, TX with a caveat: PWM timer peripheral is duplicated on two pins (A5/D2) and (A4/D3) for 7 total independent PWM outputs. For example: PWM may be used on A5 while D2 is used as a GPIO, or D2 as a PWM while A5 is used as an analog input. However A5 and D2 cannot be used as independently controlled PWM outputs at the same time.

So 7 simultaneous PWM pins is your physical limit, regardless of how you access them; Directly via the Digital Pin setting in the App, or via Virtual Pins on the App with analogWrite() in the coding.

Virtual pins however will give you more flexibility… say you want to control the simultaneous dimming of multiple LED lights with just one slider…

  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  analogWrite(D0, pinValue);
  analogWrite(D1, pinValue);
  analogWrite(D2, pinValue);

Thank you very much you are the best.