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.
Dependencies: mbed
main.cpp@36:a112aa79d726, 2020-09-28 (annotated)
- Committer:
- xavier_majorel
- Date:
- Mon Sep 28 09:36:57 2020 +0000
- Revision:
- 36:a112aa79d726
- Parent:
- 35:11db50049561
Evalution switch case
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
xavier_majorel | 28:f1e7e7d7959f | 1 | #include "mbed.h" |
dan | 0:7dec7e9ac085 | 2 | |
xavier_majorel | 36:a112aa79d726 | 3 | BusOut LED_RGB(LED3,LED2,LED1); |
xavier_majorel | 33:710cfcf55052 | 4 | |
xavier_majorel | 36:a112aa79d726 | 5 | |
xavier_majorel | 36:a112aa79d726 | 6 | BusIn nibble(SW3,D2,D3); |
xavier_majorel | 35:11db50049561 | 7 | |
xavier_majorel | 34:8f695dbf3069 | 8 | int main() |
xavier_majorel | 34:8f695dbf3069 | 9 | { |
xavier_majorel | 35:11db50049561 | 10 | while(1) |
xavier_majorel | 34:8f695dbf3069 | 11 | { |
xavier_majorel | 35:11db50049561 | 12 | switch(nibble) |
xavier_majorel | 30:b5d058925715 | 13 | { |
xavier_majorel | 36:a112aa79d726 | 14 | case 1: LED_RGB =5 ; break; |
xavier_majorel | 35:11db50049561 | 15 | |
xavier_majorel | 36:a112aa79d726 | 16 | case 0: LED_RGB =3 ; break; |
xavier_majorel | 36:a112aa79d726 | 17 | |
xavier_majorel | 36:a112aa79d726 | 18 | case 3: LED_RGB =6 ; break; |
xavier_majorel | 36:a112aa79d726 | 19 | |
xavier_majorel | 36:a112aa79d726 | 20 | case 2: LED_RGB =0 ; break; |
xavier_majorel | 36:a112aa79d726 | 21 | |
xavier_majorel | 36:a112aa79d726 | 22 | case 5: LED_RGB =4 ; break; |
xavier_majorel | 36:a112aa79d726 | 23 | |
xavier_majorel | 36:a112aa79d726 | 24 | case 4: LED_RGB =2 ; break; |
xavier_majorel | 36:a112aa79d726 | 25 | |
xavier_majorel | 36:a112aa79d726 | 26 | case 7: LED_RGB =1 ; break; |
xavier_majorel | 36:a112aa79d726 | 27 | |
xavier_majorel | 36:a112aa79d726 | 28 | case 6: LED_RGB =7 ; break; |
xavier_majorel | 36:a112aa79d726 | 29 | |
xavier_majorel | 35:11db50049561 | 30 | |
xavier_majorel | 35:11db50049561 | 31 | |
xavier_majorel | 34:8f695dbf3069 | 32 | } |
xavier_majorel | 35:11db50049561 | 33 | } |
xavier_majorel | 35:11db50049561 | 34 | } |
xavier_majorel | 35:11db50049561 | 35 | |
xavier_majorel | 35:11db50049561 | 36 | |
xavier_majorel | 35:11db50049561 | 37 | |
xavier_majorel | 34:8f695dbf3069 | 38 | |
xavier_majorel | 34:8f695dbf3069 | 39 | |
xavier_majorel | 34:8f695dbf3069 | 40 | |
xavier_majorel | 34:8f695dbf3069 | 41 | |
xavier_majorel | 34:8f695dbf3069 | 42 | |
xavier_majorel | 35:11db50049561 | 43 |