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.
Arduino.c
00001 #include "Arduino.h" 00002 #include "mbed.h" 00003 00004 00005 00006 static DigitalInOut allpins[] = {LED1, LED2, LED3, LED4, NC, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30}; 00007 00008 void digitalWrite(int pin, int value) 00009 { 00010 //allpins[pin].output(); 00011 allpins[pin].write(value); 00012 } 00013 00014 void pinMode(int pin, int mode) 00015 { 00016 if(mode == INPUT) 00017 { 00018 allpins[pin].input(); 00019 } 00020 if(mode == OUTPUT) 00021 { 00022 allpins[pin].output(); 00023 } 00024 00025 } 00026 00027 int digitalRead(int pin) 00028 { 00029 //allpins[pin].input(); 00030 return allpins[pin].read(); 00031 }
Generated on Tue Jul 26 2022 02:20:57 by
1.7.2