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: RPCInterface mbed
main.cpp@0:bb1b87ed61e6, 2016-11-08 (annotated)
- Committer:
- RichardHoekstra
- Date:
- Tue Nov 08 18:47:10 2016 +0000
- Revision:
- 0:bb1b87ed61e6
- Child:
- 1:f36fa4e37849
First update
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RichardHoekstra | 0:bb1b87ed61e6 | 1 | #include "mbed.h" |
| RichardHoekstra | 0:bb1b87ed61e6 | 2 | #include "SerialRPCInterface.h" |
| RichardHoekstra | 0:bb1b87ed61e6 | 3 | |
| RichardHoekstra | 0:bb1b87ed61e6 | 4 | |
| RichardHoekstra | 0:bb1b87ed61e6 | 5 | |
| RichardHoekstra | 0:bb1b87ed61e6 | 6 | //Mbed <-> LabView protocol werkt over USB |
| RichardHoekstra | 0:bb1b87ed61e6 | 7 | //Zie: https://developer.mbed.org/cookbook/Interfacing-with-LabVIEW |
| RichardHoekstra | 0:bb1b87ed61e6 | 8 | //We gaan vooral gebruik maken van het RPC voorbeeld. Wordt super tof |
| RichardHoekstra | 0:bb1b87ed61e6 | 9 | //Zie: https://developer.mbed.org/cookbook/Interfacing-Using-RPC voor RPC |
| RichardHoekstra | 0:bb1b87ed61e6 | 10 | |
| RichardHoekstra | 0:bb1b87ed61e6 | 11 | PwmOut led(LED1); |
| RichardHoekstra | 0:bb1b87ed61e6 | 12 | float ledDutyCycle = 0; |
| RichardHoekstra | 0:bb1b87ed61e6 | 13 | RPCVariable<float> RPCMotorOut(&ledDutyCycle, "ledDutyCycle"); |
| RichardHoekstra | 0:bb1b87ed61e6 | 14 | |
| RichardHoekstra | 0:bb1b87ed61e6 | 15 | //DIT IS EEN DEMO |
| RichardHoekstra | 0:bb1b87ed61e6 | 16 | int main() |
| RichardHoekstra | 0:bb1b87ed61e6 | 17 | { |
| RichardHoekstra | 0:bb1b87ed61e6 | 18 | led.period_ms(1);//1000Hz |
| RichardHoekstra | 0:bb1b87ed61e6 | 19 | while(true){ |
| RichardHoekstra | 0:bb1b87ed61e6 | 20 | led = ledDutyCycle; |
| RichardHoekstra | 0:bb1b87ed61e6 | 21 | wait_ms(10); |
| RichardHoekstra | 0:bb1b87ed61e6 | 22 | } |
| RichardHoekstra | 0:bb1b87ed61e6 | 23 | } |
| RichardHoekstra | 0:bb1b87ed61e6 | 24 |
