Artnet to DMX
Dependencies: mbed DMX TextLCD mbed-rtos
Art-NET to DMX converter.
Read Art-NET and process the data so it can be send by 3 XLR3 outputs for DMX. With a 4x20 display you can choose some options. For example what universe you would like on what output.
This is a project we make as our final project of our 2nd year of university. We study Electronics-ICT / Embedded ICT.
We chose for this amazing platform (MBED LPC1768) because it has al the interfaces and pins we need.
Screen.h@20:bcaba3ecc235, 2016-03-09 (annotated)
- Committer:
- Ayrton_L
- Date:
- Wed Mar 09 03:53:02 2016 +0000
- Revision:
- 20:bcaba3ecc235
- Parent:
- 19:e8b826ab28a8
- Child:
- 29:4a11f841dae1
Optimized DMX (OOP == CLASS);
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ayrton_L | 19:e8b826ab28a8 | 1 | #include "string.h" |
Ayrton_L | 19:e8b826ab28a8 | 2 | #include "stdint.h" |
Ayrton_L | 19:e8b826ab28a8 | 3 | #include "TextLCD.h" |
Ayrton_L | 19:e8b826ab28a8 | 4 | |
Ayrton_L | 19:e8b826ab28a8 | 5 | TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d4-d7 |
Ayrton_L | 19:e8b826ab28a8 | 6 | class Screen |
Ayrton_L | 19:e8b826ab28a8 | 7 | { |
Ayrton_L | 19:e8b826ab28a8 | 8 | public: |
Ayrton_L | 19:e8b826ab28a8 | 9 | Screen(); |
Ayrton_L | 19:e8b826ab28a8 | 10 | ~Screen(); |
Ayrton_L | 19:e8b826ab28a8 | 11 | |
Ayrton_L | 19:e8b826ab28a8 | 12 | void V_Printit() const; |
Ayrton_L | 19:e8b826ab28a8 | 13 | |
Ayrton_L | 19:e8b826ab28a8 | 14 | void V_SetRij(uint32_t I32_Rij); |
Ayrton_L | 19:e8b826ab28a8 | 15 | void V_SetKolom(uint32_t I32_Kolom); |
Ayrton_L | 19:e8b826ab28a8 | 16 | void V_SetTekst(char * C_Tekst); |
Ayrton_L | 19:e8b826ab28a8 | 17 | |
Ayrton_L | 19:e8b826ab28a8 | 18 | private: |
Ayrton_L | 19:e8b826ab28a8 | 19 | uint32_t I32_m_Rij; |
Ayrton_L | 19:e8b826ab28a8 | 20 | uint32_t I32_m_Kolom; |
Ayrton_L | 19:e8b826ab28a8 | 21 | char *C_m_Tekst[]; |
Ayrton_L | 19:e8b826ab28a8 | 22 | }; |
Ayrton_L | 19:e8b826ab28a8 | 23 | |
Ayrton_L | 19:e8b826ab28a8 | 24 | Screen::Screen() |
Ayrton_L | 19:e8b826ab28a8 | 25 | { |
Ayrton_L | 19:e8b826ab28a8 | 26 | this->I32_m_Rij = 0; |
Ayrton_L | 19:e8b826ab28a8 | 27 | this->I32_m_Kolom = 0; |
Ayrton_L | 19:e8b826ab28a8 | 28 | *this->C_m_Tekst = ""; |
Ayrton_L | 19:e8b826ab28a8 | 29 | return; |
Ayrton_L | 19:e8b826ab28a8 | 30 | } |
Ayrton_L | 19:e8b826ab28a8 | 31 | |
Ayrton_L | 19:e8b826ab28a8 | 32 | Screen::~Screen() |
Ayrton_L | 19:e8b826ab28a8 | 33 | { |
Ayrton_L | 19:e8b826ab28a8 | 34 | delete &I32_m_Rij; |
Ayrton_L | 19:e8b826ab28a8 | 35 | delete &I32_m_Kolom; |
Ayrton_L | 19:e8b826ab28a8 | 36 | delete C_m_Tekst; |
Ayrton_L | 19:e8b826ab28a8 | 37 | return; |
Ayrton_L | 19:e8b826ab28a8 | 38 | } |
Ayrton_L | 19:e8b826ab28a8 | 39 | |
Ayrton_L | 19:e8b826ab28a8 | 40 | void Screen::V_SetRij(uint32_t I32_Rij) |
Ayrton_L | 19:e8b826ab28a8 | 41 | { |
Ayrton_L | 19:e8b826ab28a8 | 42 | I32_m_Rij = (I32_Rij % 4) -1; |
Ayrton_L | 19:e8b826ab28a8 | 43 | } |
Ayrton_L | 19:e8b826ab28a8 | 44 | |
Ayrton_L | 19:e8b826ab28a8 | 45 | void Screen::V_SetKolom(uint32_t I32_Kolom) |
Ayrton_L | 19:e8b826ab28a8 | 46 | { |
Ayrton_L | 19:e8b826ab28a8 | 47 | I32_m_Kolom = (I32_Kolom % 20) -1; |
Ayrton_L | 19:e8b826ab28a8 | 48 | } |
Ayrton_L | 19:e8b826ab28a8 | 49 | |
Ayrton_L | 19:e8b826ab28a8 | 50 | void Screen::V_SetTekst(char C_Tekst[]) |
Ayrton_L | 19:e8b826ab28a8 | 51 | { |
Ayrton_L | 19:e8b826ab28a8 | 52 | *C_m_Tekst = C_Tekst; |
Ayrton_L | 19:e8b826ab28a8 | 53 | } |
Ayrton_L | 19:e8b826ab28a8 | 54 | |
Ayrton_L | 19:e8b826ab28a8 | 55 | void Screen::V_Printit() const |
Ayrton_L | 19:e8b826ab28a8 | 56 | { |
Ayrton_L | 19:e8b826ab28a8 | 57 | lcd.locate(I32_m_Kolom, I32_m_Rij); |
Ayrton_L | 19:e8b826ab28a8 | 58 | lcd.printf(*C_m_Tekst); |
Ayrton_L | 19:e8b826ab28a8 | 59 | } |
Ayrton_L | 19:e8b826ab28a8 | 60 | |
Ayrton_L | 19:e8b826ab28a8 | 61 | /* |
Ayrton_L | 19:e8b826ab28a8 | 62 | void V_PutPointer() |
Ayrton_L | 19:e8b826ab28a8 | 63 | { |
Ayrton_L | 19:e8b826ab28a8 | 64 | lcd.locate(0,0); |
Ayrton_L | 19:e8b826ab28a8 | 65 | lcd.printf("%d", &I8_ScreenPointer[1]); |
Ayrton_L | 19:e8b826ab28a8 | 66 | lcd.locate(1,0); |
Ayrton_L | 19:e8b826ab28a8 | 67 | lcd.printf("%d", &I8_ScreenPointer[2]); |
Ayrton_L | 19:e8b826ab28a8 | 68 | lcd.locate(2,0); |
Ayrton_L | 19:e8b826ab28a8 | 69 | lcd.printf("%d", &I8_ScreenPointer[3]); |
Ayrton_L | 19:e8b826ab28a8 | 70 | lcd.locate(3,0); |
Ayrton_L | 19:e8b826ab28a8 | 71 | lcd.printf("%d", &I8_ScreenPointer[4]); |
Ayrton_L | 19:e8b826ab28a8 | 72 | } |
Ayrton_L | 19:e8b826ab28a8 | 73 | |
Ayrton_L | 19:e8b826ab28a8 | 74 | void V_Up() |
Ayrton_L | 19:e8b826ab28a8 | 75 | { |
Ayrton_L | 19:e8b826ab28a8 | 76 | uint8_t help; |
Ayrton_L | 19:e8b826ab28a8 | 77 | help = I8_ScreenPointer[0]; |
Ayrton_L | 19:e8b826ab28a8 | 78 | I8_ScreenPointer[0] = I8_ScreenPointer[1]; |
Ayrton_L | 19:e8b826ab28a8 | 79 | I8_ScreenPointer[1] = I8_ScreenPointer[2]; |
Ayrton_L | 19:e8b826ab28a8 | 80 | I8_ScreenPointer[2] = I8_ScreenPointer[3]; |
Ayrton_L | 19:e8b826ab28a8 | 81 | I8_ScreenPointer[3] = help; |
Ayrton_L | 19:e8b826ab28a8 | 82 | V_PutPointer(); |
Ayrton_L | 19:e8b826ab28a8 | 83 | } |
Ayrton_L | 19:e8b826ab28a8 | 84 | |
Ayrton_L | 19:e8b826ab28a8 | 85 | void V_Down() |
Ayrton_L | 19:e8b826ab28a8 | 86 | { |
Ayrton_L | 19:e8b826ab28a8 | 87 | uint8_t help; |
Ayrton_L | 19:e8b826ab28a8 | 88 | help = I8_ScreenPointer[3]; |
Ayrton_L | 19:e8b826ab28a8 | 89 | I8_ScreenPointer[3] = I8_ScreenPointer[2]; |
Ayrton_L | 19:e8b826ab28a8 | 90 | I8_ScreenPointer[2] = I8_ScreenPointer[1]; |
Ayrton_L | 19:e8b826ab28a8 | 91 | I8_ScreenPointer[1] = I8_ScreenPointer[0]; |
Ayrton_L | 19:e8b826ab28a8 | 92 | I8_ScreenPointer[0] = help; |
Ayrton_L | 19:e8b826ab28a8 | 93 | V_PutPointer(); |
Ayrton_L | 19:e8b826ab28a8 | 94 | } |
Ayrton_L | 19:e8b826ab28a8 | 95 | |
Ayrton_L | 19:e8b826ab28a8 | 96 | void V_Powerup() |
Ayrton_L | 19:e8b826ab28a8 | 97 | { |
Ayrton_L | 19:e8b826ab28a8 | 98 | lcd.locate(3, 1); |
Ayrton_L | 19:e8b826ab28a8 | 99 | lcd.printf("Art-Net to DMX/n"); |
Ayrton_L | 19:e8b826ab28a8 | 100 | lcd.locate(6, 3); |
Ayrton_L | 19:e8b826ab28a8 | 101 | lcd.printf("B-00-01"); |
Ayrton_L | 19:e8b826ab28a8 | 102 | wait(1); |
Ayrton_L | 19:e8b826ab28a8 | 103 | lcd.cls(); |
Ayrton_L | 19:e8b826ab28a8 | 104 | } |
Ayrton_L | 19:e8b826ab28a8 | 105 | |
Ayrton_L | 19:e8b826ab28a8 | 106 | void V_ShowSTDMenuScreen() |
Ayrton_L | 19:e8b826ab28a8 | 107 | { |
Ayrton_L | 19:e8b826ab28a8 | 108 | lcd.cls(); |
Ayrton_L | 19:e8b826ab28a8 | 109 | |
Ayrton_L | 19:e8b826ab28a8 | 110 | lcd.locate(19,1); |
Ayrton_L | 19:e8b826ab28a8 | 111 | lcd.printf("^"); |
Ayrton_L | 19:e8b826ab28a8 | 112 | lcd.locate(19,3); |
Ayrton_L | 19:e8b826ab28a8 | 113 | lcd.printf("v"); |
Ayrton_L | 19:e8b826ab28a8 | 114 | |
Ayrton_L | 19:e8b826ab28a8 | 115 | lcd.locate(1,1); |
Ayrton_L | 19:e8b826ab28a8 | 116 | lcd.printf("Contrast"); |
Ayrton_L | 19:e8b826ab28a8 | 117 | lcd.locate(2,1); |
Ayrton_L | 19:e8b826ab28a8 | 118 | lcd.printf("Netwerk"); |
Ayrton_L | 19:e8b826ab28a8 | 119 | lcd.locate(3,1); |
Ayrton_L | 19:e8b826ab28a8 | 120 | lcd.printf("ArtNet"); |
Ayrton_L | 19:e8b826ab28a8 | 121 | lcd.locate(4,1); |
Ayrton_L | 19:e8b826ab28a8 | 122 | lcd.printf("Info"); |
Ayrton_L | 19:e8b826ab28a8 | 123 | }*/ |