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.
Dependencies: ConfigFile HCSR04 PID PPM2 mbed-rtos mbed
Revision 1:3a5a074b39e0, committed 2017-09-27
- Comitter:
- edy05
- Date:
- Wed Sep 27 17:06:19 2017 +0000
- Parent:
- 0:5cefadfd5898
- Child:
- 2:d172c9963f87
- Commit message:
- Stable release PpmRegen class
Changed in this revision
--- a/PPM.lib Fri Sep 22 11:29:54 2017 +0000 +++ b/PPM.lib Wed Sep 27 17:06:19 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/edy05/code/PPM/#64f90dca7f36 +https://os.mbed.com/users/edy05/code/PPM2/#2d4d05f95c1a
--- a/functions.h Fri Sep 22 11:29:54 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-void print_ppmIn(){
- ppmIn.getAllChannels(ppmInChannelsValue);
- for(uint8_t channel= 0; channel < 6; channel++){
- pc.printf("PPM In Channel %d: %d \n\r", channel, ppmInChannelsValue[channel]);
- }
-}
\ No newline at end of file
--- a/main.cpp Fri Sep 22 11:29:54 2017 +0000
+++ b/main.cpp Wed Sep 27 17:06:19 2017 +0000
@@ -1,7 +1,5 @@
#include "mbed.h"
-#include "PPMOut.h"
-#include "PPMIn.h"
-//#include "PPMIn.h"
+#include "PpmRegen.h"
//#include "ultrasonic.h"
//#include "MyPID.h"
@@ -11,57 +9,43 @@
#define PIEZZO_STOP 0.0
#define PPMOUT_CHANNELS 6
#define PPMIN_CHANNELS 8
+#define PPMIN_FILTERS 5
+#define ROLL 0
+#define PITCH 1
+#define YAW 2
+#define THROTTLE 3
+
+//PPM SETTINGS
+PpmRegen ppmRegen(p28, p21, p22, p23, p24, p25, p26);
Serial pc(USBTX, USBRX); // tx, rx
-PpmOut ppmOut(p26, PPMOUT_CHANNELS);
-PpmIn ppmIn(p21);
-
-uint16_t ppmOutChannelsValue[PPMOUT_CHANNELS];
uint16_t ppmInChannelsValue[PPMIN_CHANNELS];
//FUNCTIONS
-void print_ppmOut(void);
void print_ppmIn(void);
int main(){
-
+ //PPMIN SETTINGS
+ /*
+ NVIC_SetPriority(TIMER0_IRQn, 0);
+ NVIC_SetPriority(TIMER1_IRQn, 1);
+ NVIC_SetPriority(TIMER2_IRQn, 2);
+ NVIC_SetPriority(TIMER3_IRQn, 3);
+ */
+
while(1){
- print_ppmIn();
- print_ppmOut();
-
- if(ppmIn.rise_captured()){
- pc.printf("Rise captured \n\r");
- }
+ //print_ppmIn();
+ //print_ppmOut();
}
}
-
-
-
-
-
-
-
-
-
-void print_ppmOut(){
- ppmOut.getAllChannels(ppmOutChannelsValue);
-
- for(uint8_t channel= 0; channel < PPMOUT_CHANNELS; channel++){
- pc.printf("PPM Out Channel %d: %d \n\r", channel, ppmOutChannelsValue[channel]);
- }
-}
-
void print_ppmIn(){
- ppmIn.getAllChannels(ppmInChannelsValue);
+ ppmRegen.getAllChannels(ppmInChannelsValue);
for(uint8_t channel= 0; channel < PPMIN_CHANNELS; channel++){
pc.printf("PPM In Channel %d: %d \n\r", channel, ppmInChannelsValue[channel]);
}
pc.printf("\n\r");
}
-
-
-