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 RPC_DigitalInDigitalOutPWMOutoverSerial by
Diff: main.cpp
- Revision:
- 0:78952cd3935b
- Child:
- 1:de34af25056a
diff -r 000000000000 -r 78952cd3935b main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Aug 24 14:25:07 2010 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "rpc.h"
+
+Serial pc(USBTX, USBRX);
+
+int main() {
+ Base::add_rpc_class<AnalogIn>();
+ Base::add_rpc_class<AnalogOut>();
+ Base::add_rpc_class<DigitalIn>();
+ Base::add_rpc_class<DigitalOut>();
+ Base::add_rpc_class<DigitalInOut>();
+ Base::add_rpc_class<PwmOut>();
+ Base::add_rpc_class<Timer>();
+ Base::add_rpc_class<SPI>();
+ Base::add_rpc_class<BusOut>();
+ Base::add_rpc_class<BusIn>();
+ Base::add_rpc_class<BusInOut>();
+ Base::add_rpc_class<Serial>();
+
+ char buf[256], outbuf[256];
+ while(1) {
+ pc.gets(buf, 256);
+ rpc(buf, outbuf);
+ pc.printf("%s\n", outbuf);
+ }
+}
