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.
Revision 0:61da65a6f0b3, committed 2018-08-18
- Comitter:
- tyynetyyne
- Date:
- Sat Aug 18 14:11:53 2018 +0000
- Commit message:
- Moottorin ohjaaminen H-sillan avulla
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| microbit.lib | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Aug 18 14:11:53 2018 +0000
@@ -0,0 +1,26 @@
+#include "MicroBit.h"
+
+MicroBit uBit;
+
+int main(){
+ uBit.init();
+ while (1){
+ uBit.io.P1.setDigitalValue(1);
+ uBit.io.P0.setDigitalValue(0);
+ for(int i=0; i<=1023; i=i+20){
+ uBit.io.P2.setAnalogValue(i);
+ uBit.sleep(200);
+ }
+ uBit.io.P1.setDigitalValue(0);
+ uBit.sleep(500);
+ uBit.io.P0.setDigitalValue(1);
+ for(int i=1023; i>=0; i=i-20){
+ uBit.io.P2.setAnalogValue(i);
+ uBit.sleep(200);
+ }
+ uBit.io.P0.setDigitalValue(0);
+ uBit.sleep(500);
+ }
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microbit.lib Sat Aug 18 14:11:53 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/Lancaster-University/code/microbit/#4b89e7e3494f