initial commit and publish

Dependencies:   mbed

Committer:
kafka
Date:
Mon Jan 13 17:21:30 2020 +0000
Revision:
1:dcfefb503be4
Parent:
0:886ff6a91b2c
Child:
2:6a2101a16cef
second commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kafka 0:886ff6a91b2c 1 #include "mbed.h"
kafka 0:886ff6a91b2c 2 // #define BUTTON1 A1
kafka 0:886ff6a91b2c 3 #define BUTTON1 p14
kafka 0:886ff6a91b2c 4 BusOut myLeds(LED1,LED2,LED3,LED4);
kafka 0:886ff6a91b2c 5 DigitalIn button(BUTTON1);
kafka 0:886ff6a91b2c 6
kafka 0:886ff6a91b2c 7 void nibbleLeds(int value);
kafka 1:dcfefb503be4 8 void printb(uint8_t x);
kafka 0:886ff6a91b2c 9 const int INIT = 0x03;
kafka 0:886ff6a91b2c 10
kafka 0:886ff6a91b2c 11
kafka 0:886ff6a91b2c 12 int main() {
kafka 0:886ff6a91b2c 13 int anzahl, anz;
kafka 0:886ff6a91b2c 14 uint8_t value = INIT;
kafka 0:886ff6a91b2c 15 // anzahl = lauflicht(true, 400, anz = 0);
kafka 0:886ff6a91b2c 16
kafka 0:886ff6a91b2c 17 printf("anzahl = %d\n", anzahl);
kafka 0:886ff6a91b2c 18 nibbleLeds(value);
kafka 1:dcfefb503be4 19 printb(myleds);
kafka 0:886ff6a91b2c 20 wait(0.1);
kafka 1:dcfefb503be4 21 }
kafka 0:886ff6a91b2c 22
kafka 1:dcfefb503be4 23 void nibbleLeds(int value) {
kafka 1:dcfefb503be4 24 myLeds = value % 16;
kafka 0:886ff6a91b2c 25 }
kafka 1:dcfefb503be4 26
kafka 1:dcfefb503be4 27 void printb(uint8_t x){
kafka 1:dcfefb503be4 28 for(int i = sizeof() << 3; i; i--)
kafka 1:dcfefb503be4 29 putchar('0' + ((x >> (i - 1)) & 1));
kafka 1:dcfefb503be4 30 printf("\n");
kafka 1:dcfefb503be4 31 }