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.
Mu.cpp
00001 #include "Mu.h" 00002 #include "mbed.h" 00003 00004 namespace MU { 00005 Serial MuUart(MU_TX, MU_RX); 00006 00007 namespace { 00008 char Group[][4] = {"01", "02", "03", "04"}; 00009 char Channel[][4] = {"08", "14", "1F", "2E"}; 00010 char DI[][4] = {"10", "20", "40", "80"}; 00011 char EI[][4] = {"01", "02", "04", "08"}; 00012 } 00013 00014 void Mu::SendCommand(char *command, char *value, uint8_t valueLength) { 00015 MuUart.putc('@'); 00016 MuUart.putc(command[0]); 00017 MuUart.putc(command[1]); 00018 while(valueLength--) { 00019 MuUart.putc(*value); 00020 value++; 00021 } 00022 MuUart.putc('\r'); 00023 MuUart.putc('\n'); 00024 } 00025 00026 void Mu::Initialize(uint8_t select) { 00027 MuUart.baud(19200); 00028 00029 Mu::SendCommand("GI",Group[select],2); 00030 Mu::SendCommand("CH",Channel[select],2); 00031 Mu::SendCommand("DI",DI[select],2); 00032 Mu::SendCommand("EI",EI[select],2); 00033 } 00034 }
Generated on Tue Jul 12 2022 18:09:59 by
