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 ArduinoHAL by
Diff: Arduino.cpp
- Revision:
- 5:52ed7aa62e95
diff -r 40396527a068 -r 52ed7aa62e95 Arduino.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Arduino.cpp Thu Feb 12 10:19:00 2015 +0000
@@ -0,0 +1,31 @@
+#include "Arduino.h"
+#include "mbed.h"
+
+
+
+static DigitalInOut allpins[] = {D0,D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15};
+
+void digitalWrite(int pin, int value)
+{
+ //allpins[pin].output();
+ allpins[pin].write(value);
+}
+
+void pinMode(int pin, int mode)
+{
+ if(mode == INPUT)
+ {
+ allpins[pin].input();
+ }
+ if(mode == OUTPUT)
+ {
+ allpins[pin].output();
+ }
+
+}
+
+int digitalRead(int pin)
+{
+ //allpins[pin].input();
+ return allpins[pin].read();
+}
\ No newline at end of file
