Test Programm

Dependencies:   mbed

Committer:
fatima365
Date:
Mon Jan 13 17:31:07 2020 +0000
Revision:
1:b6f2a3f6e8eb
Parent:
0:7b78c5f07317
Child:
2:b43b5da6f341
2FUnkt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fatima365 0:7b78c5f07317 1 #include "mbed.h"
fatima365 0:7b78c5f07317 2 #define BUTTON1 p14 // M3: push joystick pin
fatima365 0:7b78c5f07317 3 //#define BUTTON A1 // NUCLEO:Taster A1
fatima365 0:7b78c5f07317 4
fatima365 0:7b78c5f07317 5 //int modifybBit (int x, unsigned char position, bool State);
fatima365 0:7b78c5f07317 6 //int lauflicht (bool richtung, int time, int &anz);
fatima365 1:b6f2a3f6e8eb 7 void nibbleLeds (int value);
fatima365 0:7b78c5f07317 8 //void printb (uint8_t x);
fatima365 0:7b78c5f07317 9
fatima365 0:7b78c5f07317 10 BusOut myleds(LED1, LED2, LED3, LED4);
fatima365 0:7b78c5f07317 11 DigitalIn button(BUTTON1);
fatima365 0:7b78c5f07317 12
fatima365 0:7b78c5f07317 13 const int INIT = 0x03;
fatima365 0:7b78c5f07317 14
fatima365 0:7b78c5f07317 15 int main() {
fatima365 1:b6f2a3f6e8eb 16 int anzahl, anz;
fatima365 1:b6f2a3f6e8eb 17 uint8_t value = INIT;
fatima365 1:b6f2a3f6e8eb 18
fatima365 1:b6f2a3f6e8eb 19 nibbleLeds(value);
fatima365 1:b6f2a3f6e8eb 20 wait (0.1);
fatima365 1:b6f2a3f6e8eb 21 }
fatima365 1:b6f2a3f6e8eb 22
fatima365 1:b6f2a3f6e8eb 23 void nibbleLeds(int value){
fatima365 1:b6f2a3f6e8eb 24 myleds = value%16;
fatima365 1:b6f2a3f6e8eb 25 }