Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of STX3_Switch by
Diff: main.cpp
- Revision:
- 1:d140f24cf386
- Parent:
- 0:88a700f174a3
- Child:
- 2:a79ceae53e04
--- a/main.cpp Fri Oct 27 07:02:16 2017 +0000
+++ b/main.cpp Mon Oct 30 19:58:19 2017 +0000
@@ -13,9 +13,11 @@
Thread thread;
void respuesta(){
+ while(1){
if(device.readable()) { // Se esperan datos provenientes del TX del módulo STX3
pc.putc(device.getc()); // Se muestra en pantalla la respuesta recibida por el módulo STX3 como una reacción al mensaje en HEX enviado
}
+ }
}
void stx3()
@@ -41,12 +43,12 @@
{
led1=!led1;
stx3();
- Thread::wait(100); // Se esperan .1 segundos, para realizar la transmisiones.
- device.putc(0XAA); // Se envía un mensaje en Hexadecimal, dado por GlobalStar
+ Thread::wait(100); // Query ESN
+ device.putc(0XAA);
device.putc(0X05);
- device.putc(0X04);
- device.putc(0XFD);
- device.putc(0X82);
+ device.putc(0X01);
+ device.putc(0X50);
+ device.putc(0XD5);
Thread::wait(100); // Se esperan .1 segundos una vez que se terminaron de hacer las transmisiones
//El tiempo total de transmisión es; el wait previo a las transmisiones, el tiempo que tarda el Mu en enviar los datos y el wait posterior a la transmisión
RTS=1;
@@ -58,8 +60,8 @@
{
led2=!led2;
stx3();
- Thread::wait(100); // Se esperan .1 segundos, para realizar la transmisiones.
- device.putc(0XAA); // Se envía un mensaje en Hexadecimal, dado por GlobalStar
+ Thread::wait(100); // Query Bursts Remaining
+ device.putc(0XAA);
device.putc(0X05);
device.putc(0X04);
device.putc(0XFD);
@@ -75,12 +77,12 @@
{
led3=!led3;
stx3();
- Thread::wait(100); // Se esperan .1 segundos, para realizar la transmisiones.
- device.putc(0XAA); // Se envía un mensaje en Hexadecimal, dado por GlobalStar
+ Thread::wait(100); // Query Firmware Version
+ device.putc(0XAA);
device.putc(0X05);
- device.putc(0X04);
- device.putc(0XFD);
- device.putc(0X82);
+ device.putc(0X05);
+ device.putc(0X74);
+ device.putc(0X93);
Thread::wait(100); // Se esperan .1 segundos una vez que se terminaron de hacer las transmisiones
//El tiempo total de transmisión es; el wait previo a las transmisiones, el tiempo que tarda el Mu en enviar los datos y el wait posterior a la transmisión
RTS=1;
