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.
main.cpp
00001 // 00002 // INTEGER TO BINARY by J.P. Armstrong 00003 // http://www.armtronics.com/ 00004 // 00005 // Improved by Igor Skochinsky 00006 // 00007 // PART OF CODE FROM: 00008 // http://mbed.org/cookbook/Assembly-Language 00009 00010 #include "mbed.h" 00011 00012 // This program will blink LED1 and LED4 00013 // using assembly language for LED1 and 00014 // API functions for LED4 00015 // declare external assembly language function (in a *.s file) 00016 extern "C" int binasm(int value); 00017 // declare LED outputs � let C set them up as output bits 00018 00019 DigitalOut myled1(LED1); 00020 DigitalOut myled2(LED2); 00021 DigitalOut myled3(LED3); 00022 DigitalOut myled4(LED4); 00023 00024 int main() { 00025 00026 int i = 1; 00027 00028 while (true) { 00029 binasm(i % 16); 00030 wait(0.1); 00031 i++; 00032 } 00033 00034 }
Generated on Fri Jul 15 2022 22:21:45 by
1.7.2