Tech-dat/PWM-dat/PWM-dat.md
... ...
@@ -1,13 +1,10 @@
1
-
2 1
# PWM-dat
3 2
4 3
- arduino code example - [[arduino-fading.ino]]
5 4
6
-
7
-
8 5
## read RC signal
9 6
10
-- [[RC-link-dat]]
7
+- [[RC-link-dat]] - [[PPM-dat]]
11 8
12 9
Basic setup:
13 10
... ...
@@ -39,7 +36,64 @@ Use pulseIn() to read the high-pulse duration.
39 36
delay(100); // Limit output rate
40 37
}
41 38
39
+update into four channels, and add timeout to prevent lockup if a signal is lost.
40
+
41
+ // Define pins for each RC channel
42
+ int aileronPin = 2; // Channel 1
43
+ int elevatorPin = 3; // Channel 2
44
+ int throttlePin = 4; // Channel 3
45
+ int rudderPin = 5; // Channel 4
46
+ // Channel 5 is often unused or for gear/aux, skipping for this example
47
+ int flapPitchPin = 6; // Channel 6
48
+
49
+ // Variables to store PWM values
50
+ unsigned long aileronPWM;
51
+ unsigned long elevatorPWM;
52
+ unsigned long throttlePWM;
53
+ unsigned long rudderPWM;
54
+ unsigned long flapPitchPWM;
55
+
56
+ void setup() {
57
+ pinMode(aileronPin, INPUT);
58
+ pinMode(elevatorPin, INPUT);
59
+ pinMode(throttlePin, INPUT);
60
+ pinMode(rudderPin, INPUT);
61
+ pinMode(flapPitchPin, INPUT);
62
+ Serial.begin(9600);
63
+ }
64
+
65
+ void loop() {
66
+ // Read PWM signal for each channel
67
+ // Timeout of 25000 microseconds (25ms) to prevent lockup if a signal is lost
68
+ aileronPWM = pulseIn(aileronPin, HIGH, 25000);
69
+ elevatorPWM = pulseIn(elevatorPin, HIGH, 25000);
70
+ throttlePWM = pulseIn(throttlePin, HIGH, 25000);
71
+ rudderPWM = pulseIn(rudderPin, HIGH, 25000);
72
+ flapPitchPWM = pulseIn(flapPitchPin, HIGH, 25000);
73
+
74
+ // Print the values to the Serial Monitor
75
+ Serial.print("Aileron: ");
76
+ Serial.print(aileronPWM);
77
+ Serial.print(" us, Elevator: ");
78
+ Serial.print(elevatorPWM);
79
+ Serial.print(" us, Throttle: ");
80
+ Serial.print(throttlePWM);
81
+ Serial.print(" us, Rudder: ");
82
+ Serial.print(rudderPWM);
83
+ Serial.print(" us, Flap/Pitch: ");
84
+ Serial.print(flapPitchPWM);
85
+ Serial.println(" us");
86
+
87
+ delay(100); // Limit output rate to make it readable
88
+ }
89
+
90
+Description:
42 91
92
+- **throttlePWM**: Variable to store the duration (in microseconds) of the incoming PWM signal.
93
+- **pulseIn()**: Arduino function that measures how long a pin stays at a specified level (HIGH or LOW).
94
+- **throttlePin**: Digital pin receiving the PWM signal (e.g., from an RC receiver).
95
+- **HIGH**: Measure the duration of the HIGH part of the PWM pulse.
96
+- **25000**: Timeout value in microseconds (25 ms). If no pulse is detected within this time, the function returns 0.
43 97
44 98
## boards
45 99
Tech-dat/tech-dat.md
... ...
@@ -85,7 +85,7 @@
85 85
86 86
## Code
87 87
88
-- [[arduino-ide-dat]]
88
+- [[arduino-ide-dat]] - [[PWM-dat]]
89 89
90 90
- [[logic-dat]]
91 91
app-dat/RC-dat/RC-link-dat/RC-link-dat.md
... ...
@@ -1,7 +1,7 @@
1 1
2 2
# RC-link-dat
3 3
4
-- [[Wfly-dat]]
4
+- [[Wfly-dat]] - [[WFT06x-dat]] - [[WFR06S-dat]]
5 5
6 6
## RC Receiver
7 7
app-dat/RC-dat/RC-protocols/PPM-dat/PPM-dat.md
... ...
@@ -0,0 +1,27 @@
1
+
2
+# PPM-dat
3
+
4
+- [[Wfly-dat]]
5
+
6
+- [[PWM-dat]]
7
+
8
+PPM (Pulse Position Modulation) is a type of analog signal used in radio control (RC) systems to transmit multiple channels of control information (like throttle, steering, elevator, etc.) over a single wire.
9
+
10
+In simple terms:
11
+
12
+- It sends a series of pulses.
13
+- The position (or timing) of each pulse within a repeating frame represents the value for a specific channel.
14
+- A longer "sync" pulse marks the end of one frame and the beginning of the next.
15
+
16
+So, instead of needing a separate wire for each control channel, PPM combines them into one sequential signal.
17
+
18
+## demo video
19
+
20
+[RC #PPM PWM send and receive at Arduino, note the four channels color](https://youtube.com/shorts/BDdSFPlh9KE?si=n1oF2KUIMqEeH1QW)
21
+
22
+
23
+
24
+
25
+## ref
26
+
27
+- [[RC-protocols-dat]]
... ...
\ No newline at end of file
app-dat/RC-dat/WFLY-dat/WFT06X-dat.md
... ...
@@ -1,5 +1,7 @@
1 1
# WFLY-dat
2 2
3
+- [[PPM-dat]]
4
+
3 5
![](2025-05-05-14-45-14.png)
4 6
5 7
![](2025-05-05-14-51-22.png)
... ...
@@ -92,11 +94,11 @@ Switch Function Instruction
92 94
* HDE Helicopter (Channel 3 to Channel 4 & 6 mix)
93 95
* HDE Helicopter (Channel 3 to Channel 6 mix)
94 96
* **Reverse Switches:**
95
- * Channel 1: Aileron
96
- * Channel 2: Elevator
97
- * Channel 3: Throttle
98
- * Channel 4: Rudder
99
- * Channel 6: Flap/Pitch
97
+ * Channel 1: Aileron 副翼
98
+ * Channel 2: Elevator 升降舵
99
+ * Channel 3: Throttle 油门
100
+ * Channel 4: Rudder 方向舵
101
+ * Channel 6: Flap/Pitch 襟翼/螺距
100 102
* **Low Voltage Alarm (Visual & Audible):**
101 103
* Battery Voltage < 8.8V: Power indicator flashes once per second with beeping.
102 104
* Battery Voltage < 8.3V: Power indicator flashes twice per second (0.5s interval) with beeping.
... ...
@@ -104,6 +106,20 @@ Switch Function Instruction
104 106
* **Simulator Jack:** Yes
105 107
106 108
109
+## Beeping
110
+
111
+According to the document, the device will provide a sound-and-light notification when the battery voltage is low.  
112
+
113
+**When the battery voltage is below 8.8V**, the power indicator light will glitter and buzz at a rate of 1S/1S.  
114
+
115
+**When the battery voltage drops below 8.3V**, the power indicator light will glitter and buzz at a rate of 0.5S/1S.  
116
+
117
+Additionally, the WFT06X-C model transmitter will alarm if it is turned on in an Idle-up state with no output.  
118
+
119
+
120
+
121
+
122
+
107 123
## demo video
108 124
109 125
- [how to binding WFLY in chinese ](https://www.bilibili.com/video/BV1Mh4y1c7FS/?vd_source=74a6b8b9bfcd41c5946a742815bf71ae)