Jump to content

cBass

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by cBass

  1. Same issue connect serial port not working My issue is the same as this video except his solution doesn't work with my win10 laptop rebooting running as admin checking Arduino port numbers to match connect serial port file does nothing it just hangs like the video. ${1}
  2. TCP commands Using zerobrane to open tcp connection to send commands to pull t handles. I can see a tcp socket open through netstat but no joy on dcs getting the commands any hints? while true do local server = assert(s.bind("127.0.0.1",7778)) print("waiting for connection on port 7778 ") local client = server:accept() print("connected") client:send("FIRE_EXT_DISCH INC \n") client:send("FIRE_EXT_DISCH DEC \n") -- sleep(10) client:send("FIRE_LENG_PULL INC\n") client:send("FIRE_LENG_PULL DEC\n") client:settimeout(10) end
  3. Did an instructional video using dcsbios to drive an oled display.
  4. Solved kinda Looks like there was nothing wrong with the software or hardware it was the starting sequence for DCS. If you start DCS up first go in the cockpit then start up connect serial port software you will see the data flowing in the command window but no data will be sent to the display. You have to start the serial connect software first then the game and it will work.I dont know how many times I've been burned by this.duh...
  5. Anyone using the u8g2 library in dcsbios? I can write to the nhd 256X56 ssd1322 display using dwrString function but dwrString doesnt work in the dcsbois function. The u8g2 print function doesnt work at all. Can someone explain how the dcs function works? It looks like the character newValue pointer is pointing at the 8 member <stringBuffer>array? So I should be able to dereference this pointer in the u8g2 dwrStr function and iterate through the <stringBuffer> array? Or should I point the dwrString function string pointer at the *newValue pointer? Also why doesnt u8g2.print(newValue); work? /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_IRQ_SERIAL #include <Arduino.h> #include <U8g2lib.h> #include <U8x8lib.h> #include "DcsBios.h" #include <SPI.h> /*8************************************************************************************** * U8G2_R0 = zero rotation, clock = SCK,data = MOSI, * cs = chip select,dc = data command, reset = reset line * MOSI = 51; * MISO = 50; * SCK = 52; ****************************************************************************************/ const int RESET = 44; const int myCS = 43; const int myDC = 42; //object insantiated U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI myu8g2(U8G2_R0,52,51,myCS,myDC,RESET); //this doesnt work void onCmscTxtJmrChange(char* newValue) { /* code goes here */ myu8g2.firstPage(); do { myu8g2.setFont(u8g2_font_ncenB14_tr); myu8g2.drawStr(0,15,newValue); } while ( myu8g2.nextPage() ); /* This doesnt work myu8g2.setFont(u8g2_font_ncenB14_tr); myu8g2.setCursor(0, 15); myu8g2.print(newValue);*/ } DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange); void setup() { pinMode(RESET, OUTPUT); pinMode(MOSI, OUTPUT); pinMode(MISO, OUTPUT); pinMode(SCK, OUTPUT); pinMode(myCS, OUTPUT); pinMode(myDC, OUTPUT); //this doesnt work myu8g2.begin(); myu8g2.clear(); myu8g2.setFontMode(0); myu8g2.setDrawColor(1); myu8g2.setFont(u8g2_font_7x13B_tf); myu8g2.setCursor(0, 15); myu8g2.print("hello"); //This works displays correctly on oled nhd display myu8g2.firstPage(); do { myu8g2.setFont(u8g2_font_ncenB14_tr); myu8g2.drawStr(0,15,"Hello World!"); } while ( myu8g2.nextPage() ); delay(2000); DcsBios::setup(); } void loop() { DcsBios::loop(); }
  6. The diamond or lozenge appears every time you deploy chaff or flare. Usually there is a lower case letter that is underlined where the diamond appears signifying the mode your in ie. standby ,manual ect.(I don't know the ascii for that symbol either?) This underlined letter disappears when chaff or flare is discharged and replaced by the diamond. To test I just do instant action (starts you in the air) then nellis weapons practice then change to manual mode and hit key seven to kick out flare. Dont know how to or if you can with WoW?
  7. Thank's for testing Ian. I must still have a hardware issue somewhere. What ascii bytes representing special characters especially the diamond (lozenge?) between chaff and flare does DCS use ?
  8. DCS bios question I have a working master caution led from the library example but as soon as I insert my own code to write to osram displays it stops working. I dont even make any calls to my own functions and it still doesnt work but if I go back to the dcs bios library mcled example it works again. How can it not wortk if I dont even make any calls to any functions except the mcled? p.s. pin 42 is the led on my custom board. #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <SPI.h> /* Declare a Master Caution Reset button on pin 10 */ DcsBios::Switch2Pos masterCautionBtn("UFC_MASTER_CAUTION", 10); /* Make the LED connected to pin 13 into a Master Caution Light */ DcsBios::LED mcLed(0x1012, 0x0800, 42); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } //write character to osram serial display void dcsBios_tste_write_char(char myValue[],int load_value,char* mycompValue){ for(int i=0; i<8;i++){ digitalWrite(load_value, HIGH); digitalWrite(load_value, LOW); SPI.transfer(myValue[i]); digitalWrite(load_value, HIGH); my_comparator_func(mycompValue++); // write_master_array(_L); delayMicroseconds(1);} } //write to jammer osram display void dcsBios_tste_write_slave_char(char myValue[],int load_value,char* mycompValue){ for(int i=0; i<8;i++){ digitalWrite(load_value, HIGH); digitalWrite(load_value, LOW); SPI.transfer(myValue[i]); digitalWrite(load_value, HIGH); my_comparator_slave_func(mycompValue++); // write_master_array(_L); delayMicroseconds(1);} } const int RESET = 44; const int master_LOAD = 46; const int slave_LOAD = 28; char *myPtr; //character ascii library char _num[10]= {0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,}; char load_digit[8] = {0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7}; char _excl[7] = {0x04,0x04,0x04,0x04,0x04,0x00,0x04}; char _quote [7] = {0x0A,0x0A,0x00,0x00,0x00,0x00,0x00}; char _pound [7] = {0x0A,0x0A,0x1F,0x0A,0x0F,0x0A,0x0A}; char _dollar[7] = {0x04,0x0F,0x14,0x0E,0x05,0x1E,0x04}; char _percent[7]= {0x18,0x19,0x02,0x04,0x08,0x13,0x03}; char _ampersand[7]= {0x18,0x19,0x02,0x04,0x08,0x13,0x03}; char _singlequote[7]={0x0C,0x0C,0x08,0x04,0x00,0x00,0x00}; char l_brack[7] = {0x02,0x04,0x04,0x04,0x04,0x04,0x02}; char r_brack[7] = {0x08,0x04,0x04,0x04,0x04,0x04,0x08}; char asterick[7] = {0x00,0x0A,0x04,0x1F,0x04,0x0A,0x00}; char _plus[7] = {0x00,0x04,0x04,0x1F,0x04,0x04,0x00}; char _comma[7] = {0x00,0x00,0x00,0x18,0x18,0x08,0x10}; char _minus[7] = {0x00,0x00,0x00,0x1F,0x00,0x00,0x00}; char _period[7] = {0x00,0x00,0x00,0x00,0x00,0x0C,0x0C}; char _fwdslsh[7] = {0x00,0x01,0x02,0x04,0x08,0x10,0x00}; char _0[7] = {0x0E,0x11,0x13,0x15,0x19,0x11,0x0E}; char _1[7] = {0x04,0x0C,0x04,0x04,0x04,0x04,0x0E}; char _2[7] = {0x0E,0x11,0x01,0x06,0x08,0x10,0x1F}; char _3[7] = {0x0E,0x11,0x01,0x0E,0x01,0x11,0x0E}; char _4[7] = {0x02,0x06,0x0A,0x12,0x1F,0x02,0x02}; char _5[7] = {0x1F,0x10,0x1E,0x01,0x01,0x01,0x1E}; char _6[7] = {0x06,0x08,0x10,0x1E,0x11,0x11,0x0E}; char _7[7] = {0x1F,0x01,0x02,0x04,0x08,0x08,0x08}; char _8[7] = {0x0E,0x11,0x11,0x0E,0x11,0x11,0x0E}; char _9[7] = {0x0E,0x11,0x11,0x0F,0x01,0x02,0x0C}; char _colon[7] = {0x00,0x0C,0x0C,0x00,0x0C,0x0C,0x00}; char _semi [7] = {0x0C,0x0C,0x00,0x0C,0x0C,0x04,0x08}; char _less[7] = {0x01,0x02,0x04,0x08,0x04,0x02,0x01}; char _equal[7] = {0x00,0x00,0x1F,0x00,0x1F,0x00,0x00}; char _greater[7]= {0x10,0x08,0x04,0x02,0x04,0x08,0x10}; char _question [7] = {0x0E,0x11,0x01,0x02,0x04,0x00,0x04}; char _at [7] = {0x0A,0x00,0x0E,0x12,0x12,0x12,0x0D}; char _A[7] = {0x0E,0x11,0x11,0x1F,0x11,0x11,0x11}; char _B[7] = {0x1E,0x11,0x11,0x1E,0x11,0x11,0x1E}; char _C[7] = {0x0E,0x11,0x10,0x10,0x10,0x11,0x0E}; char _D[7] = {0x1E,0x11,0x11,0x11,0x11,0x11,0x1E}; char _E[7] = {0x1F,0x10,0x10,0x1E,0x10,0x10,0x1F}; char _F[7] = {0x1F,0x10,0x10,0x1E,0x10,0x10,0x10}; char _G[7] = {0x0E,0x11,0x10,0x10,0x13,0x11,0x0E}; char _H[7] = {0x11,0x11,0x11,0x1F,0x11,0x11,0x11}; char _I[7] = {0x07,0x04,0x04,0x04,0x04,0x04,0x07}; char _J[7] = {0x01,0x01,0x01,0x01,0x01,0x11,0x0E}; char _K[7] = {0x11,0x12,0x14,0x18,0x14,0x12,0x11}; char _L[7] = {0x10,0x10,0x10,0x10,0x10,0x10,0x1F}; char _M[7] = {0x11,0x1B,0x15,0x15,0x11,0x11,0x11}; char _N[7] = {0x11,0x11,0x19,0x15,0x13,0x11,0x11}; char _O[7] = {0x0E,0x11,0x11,0x11,0x11,0x11,0x0E}; char _P[7] = {0x1E,0x11,0x11,0x1E,0x10,0x10,0x10}; char _Q [7] = {0x0E,0x11,0x11,0x11,0x15,0x12,0x0D}; char _R[7] = {0x1E,0x11,0x11,0x1E,0x14,0x12,0x11}; char _S[7] = {0x0E,0x11,0x10,0x0E,0x01,0x11,0x0E}; char _T[7] = {0x0F,0x04,0x04,0x04,0x04,0x04,0x04}; char _U[7] = {0x11,0x11,0x11,0x11,0x11,0x11,0x0E}; char _V[7] = {0x11,0x11,0x11,0x0A,0x0A,0x04,0x04}; char _W[7] = {0x11,0x11,0x11,0x15,0x15,0x1B,0x11}; char _X[7] = {0x11,0x11,0x0A,0x04,0x0A,0x11,0x11}; char _Y[7] = {0x11,0x11,0x11,0x0A,0x0A,0x04,0x04}; char _Z[7] = {0x1F,0x01,0x02,0x04,0x08,0x10,0x1F}; char _lbrack[7] = {0x07,0x04,0x04,0x04,0x04,0x04,0x07}; char _bkslsh[7] = {0x00,0x10,0x08,0x04,0x02,0x01,0x00}; char _rbrack[7] = {0x1C,0x04,0x04,0x04,0x04,0x04,0x1C}; char _pyramid[7]= {0x04,0x0A,0x11,0x00,0x00,0x00,0x00}; char _underln[7]= {0x00,0x00,0x00,0x00,0x00,0x00,0x1F}; char _l_apos [7]= {0x0C,0x0C,0x04,0x08,0x00,0x00,0x00}; char _a[7] = {0x00,0x00,0x0E,0x12,0x12,0x12,0x0D}; char _b[7] = {0x10,0x10,0x10,0x16,0x19,0x11,0x1E}; char _c[7] = {0x00,0x00,0x0E,0x10,0x10,0x11,0x0E}; char _d[7] = {0x01,0x01,0x01,0x0D,0x13,0x11,0x0F}; char _e[7] = {0x00,0x00,0x0E,0x11,0x0E,0x10,0x0E}; char _f[7] = {0x04,0x0A,0x08,0x1C,0x08,0x08,0x08}; char _g[7] = {0x00,0x00,0x0F,0x11,0x0F,0x01,0x06}; char _h[7] = {0x10,0x10,0x16,0x19,0x11,0x11,0x11}; char _i[7] = {0x00,0x04,0x00,0x0C,0x04,0x04,0x0E}; char _j[7] = {0x02,0x00,0x06,0x02,0x02,0x12,0x0C}; char _k[7] = {0x10,0x01,0x12,0x14,0x18,0x14,0x12}; char _l[7] = {0x0C,0x04,0x04,0x04,0x04,0x04,0x0E}; char _m[7] = {0x00,0x00,0x0A,0x15,0x11,0x11,0x11}; char _n[7] = {0x00,0x00,0x16,0x19,0x11,0x11,0x11}; char _o[7] = {0x00,0x00,0x0E,0x11,0x11,0x11,0x0E}; char _p[7] = {0x00,0x00,0x1E,0x11,0x19,0x16,0x10}; char _q[7] = {0x00,0x00,0x0F,0x11,0x13,0x0D,0x01}; char _r[7] = {0x00,0x00,0x0B,0x0C,0x08,0x08,0x08}; char _s[7] = {0x00,0x00,0x0E,0x10,0x0E,0x01,0x1E}; char _t[7] = {0x08,0x08,0x1C,0x08,0x08,0x0A,0x04}; char _u[7] = {0x00,0x00,0x11,0x11,0x11,0x13,0x0D}; char _v[7] = {0x00,0x00,0x11,0x11,0x11,0x0A,0x04}; char _w[7] = {0x00,0x00,0x11,0x11,0x15,0x15,0x0A}; char _x[7] = {0x00,0x00,0x11,0x0A,0x04,0x0A,0x11}; char _y[7] = {0x00,0x00,0x11,0x0A,0x04,0x04,0x08}; char _z[7] = {0x00,0x00,0x1F,0x02,0x04,0x08,0x1F}; char _l_brace[7]= {0x02,0x04,0x04,0x08,0x04,0x04,0x02}; char _bar [7] = {0x04,0x04,0x04,0x00,0x04,0x04,0x04}; char _r_brace[7] = {0x08,0x04,0x04,0x02,0x04,0x04,0x08}; char _tilde[7] = {0x00,0x00,0x08,0x05,0x02,0x00,0x00}; char _fill [7] = {0x0A, 0x15,0x0A,0x15,0x0A,0x15,0x0A}; char _arrow[7] = {0x04,0x0E,0x15,0x04,0x04,0x04,0x04}; char _blank[7] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00}; void write_char(char myValue,char load_value){ digitalWrite(load_value, HIGH); digitalWrite(load_value, LOW); SPI.transfer(myValue); digitalWrite(load_value, HIGH); delayMicroseconds(1); } void write_master_array(char myArray[]){ // SPI.begin(); myPtr = myArray; for(int x = 0;x<7;x++){ write_char(*myPtr++,master_LOAD); } // SPI.end(); } void write_slave_array(char myArray[]){ // SPI.begin(); myPtr = myArray; for(int x = 0;x<7;x++){ write_char(*myPtr++,slave_LOAD); } // SPI.end(); } //compare ascii number to library void my_comparator_func(char* myValue){ switch (*myValue) { case 0x21: write_master_array(_excl); break; case 0x22: write_master_array(_quote); break; case 0x23: write_master_array(_pound); break; case 0x24: write_master_array(_dollar); break; case 0x25: write_master_array(_percent); break; case 0x26: write_master_array(_ampersand); break; case 0x27: write_master_array(_0); break; case 0x28: write_master_array(l_brack); break; case 0x29: write_master_array(r_brack); break; case 0x2A: write_master_array(asterick); break; case 0x2B: write_master_array(_plus); break; case 0x2C: write_master_array(_l_apos); break; case 0x2D: write_master_array(_minus); break; case 0x2E: write_master_array(_period); break; case 0x2F: write_master_array(_fwdslsh); break; case 0x30: write_master_array(_0); break; case 0x31: write_master_array(_1); break; case 0x32: write_master_array(_2); break; case 0x33: write_master_array(_3); break; case 0x34: write_master_array(_4); break; case 0x35: write_master_array(_5); break; case 0x36: write_master_array(_6); break; case 0x37: write_master_array(_7); break; case 0x38: write_master_array(_8); break; case 0x39: write_master_array(_9); break; case 0x3A: write_master_array(_colon); break; case 0x3B: write_master_array(_semi); break; case 0x3C: write_master_array(_less); break; case 0x3D: write_master_array(_equal); break; case 0x3E: write_master_array(_greater); break; case 0x3F: write_master_array(_question); break; case 0x40: write_master_array(_at); break; case 0x41: write_master_array(_A); break; case 0x42: write_master_array(_B); break; case 0x43: write_master_array(_C); break; case 0x44: write_master_array(_D); break; case 0x45: write_master_array(_E); break; case 0x46: write_master_array(_F); break; case 0x47: write_master_array(_G); break; case 0x48: write_master_array(_H); break; case 0x49: write_master_array(_I); break; case 0x4A: write_master_array(_J); break; case 0x4B: write_master_array(_K); break; case 0x4C: write_master_array(_L); break; case 0x4D: write_master_array(_M); break; case 0x4E: write_master_array(_N); break; case 0x4F: write_master_array(_O); break; case 0x50: write_master_array(_P); break; case 0x51: write_master_array(_Q); break; case 0x52: write_master_array(_R); break; case 0x53: write_master_array(_S); break; case 0x54: write_master_array(_T); break; case 0x55: write_master_array(_U); break; case 0x56: write_master_array(_V); break; case 0x57: write_master_array(_W); break; case 0x58: write_master_array(_X); break; case 0x59: write_master_array(_Y); break; case 0x5A: write_master_array(_Z); break; case 0x5B: write_master_array(l_brack); break; case 0x5C: write_master_array(_bkslsh); break; case 0x5D: write_master_array(r_brack); break; case 0x5E: write_master_array(_pyramid); break; case 0x5F: write_master_array(_underln); break; case 0x60: write_master_array(_l_apos); break; case 0x61: write_master_array(_a); break; case 0x62: write_master_array(_b); break; case 0x63: write_master_array(_c); break; case 0x64: write_master_array(_d); break; case 0x65: write_master_array(_e); break; case 0x66: write_master_array(_f); break; case 0x67: write_master_array(_g); break; case 0x68: write_master_array(_h); break; case 0x69: write_master_array(_i); break; case 0x6A: write_master_array(_j); break; case 0x6B: write_master_array(_k); break; case 0x6C: write_master_array(_l); break; case 0x6D: write_master_array(_m); break; case 0x6E: write_master_array(_n); break; case 0x6F: write_master_array(_o); break; case 0x70: write_master_array(_p); break; case 0x71: write_master_array(_q); break; case 0x72: write_master_array(_r); break; case 0x73: write_master_array(_s); break; case 0x74: write_master_array(_t); break; case 0x75: write_master_array(_u); break; case 0x76: write_master_array(_v); break; case 0x77: write_master_array(_w); break; case 0x78: write_master_array(_x); break; case 0x79: write_master_array(_y); break; case 0x7A: write_master_array(_z); break; case 0x7B: write_master_array(_l_brace); break; case 0x7C: write_master_array(_bar); break; case 0x7D: write_master_array(_r_brace); break; case 0x7E: write_master_array(_tilde); break; case 0x7F: write_master_array(_arrow); break; default: write_master_array(_blank); break; } } void dcsBios_load_digit(char load_digit,char* myValue){ digitalWrite(master_LOAD, HIGH); digitalWrite(master_LOAD, LOW); SPI.transfer(load_digit); digitalWrite(master_LOAD, HIGH); delayMicroseconds(1); my_comparator_func(*myValue); load_digit++; } void my_comparator_slave_func(char* myValue){ switch (*myValue) { case 0x21: write_slave_array(_excl); break; case 0x22: write_slave_array(_quote); break; case 0x23: write_slave_array(_pound); break; case 0x24: write_slave_array(_dollar); break; case 0x25: write_master_array(_percent); break; case 0x26: write_master_array(_ampersand); break; case 0x27: write_master_array(_0); break; case 0x28: write_master_array(l_brack); break; case 0x29: write_master_array(r_brack); break; case 0x2A: write_master_array(asterick); break; case 0x2B: write_master_array(_plus); break; case 0x2C: write_master_array(_l_apos); break; case 0x2D: write_master_array(_minus); break; case 0x2E: write_master_array(_period); break; case 0x2F: write_master_array(_fwdslsh); break; case 0x30: write_slave_array(_0); break; case 0x31: write_slave_array(_1); break; case 0x32: write_slave_array(_2); break; case 0x33: write_slave_array(_3); break; case 0x34: write_slave_array(_4); break; case 0x35: write_slave_array(_5); break; case 0x36: write_slave_array(_6); break; case 0x37: write_slave_array(_7); break; case 0x38: write_slave_array(_8); break; case 0x39: write_slave_array(_9); break; case 0x3A: write_master_array(_colon); break; case 0x3B: write_master_array(_semi); break; case 0x3C: write_master_array(_less); break; case 0x3D: write_master_array(_equal); break; case 0x3E: write_master_array(_greater); break; case 0x3F: write_master_array(_question); break; case 0x40: write_master_array(_at); break; case 0x41: write_slave_array(_A); break; case 0x42: write_slave_array(_B); break; case 0x43: write_slave_array(_C); break; case 0x44: write_slave_array(_D); break; case 0x45: write_slave_array(_E); break; case 0x46: write_slave_array(_F); break; case 0x47: write_slave_array(_G); break; case 0x48: write_slave_array(_H); break; case 0x49: write_slave_array(_I); break; case 0x4A: write_slave_array(_J); break; case 0x4B: write_slave_array(_K); break; case 0x4C: write_slave_array(_L); break; case 0x4D: write_slave_array(_M); break; case 0x4E: write_slave_array(_N); break; case 0x4F: write_slave_array(_O); break; case 0x50: write_slave_array(_P); break; case 0x51: write_slave_array(_Q); break; case 0x52: write_slave_array(_R); break; case 0x53: write_slave_array(_S); break; case 0x54: write_slave_array(_T); break; case 0x55: write_slave_array(_U); break; case 0x56: write_slave_array(_V); break; case 0x57: write_slave_array(_W); break; case 0x58: write_slave_array(_X); break; case 0x59: write_slave_array(_Y); break; case 0x5A: write_slave_array(_Z); break; case 0x5B: write_slave_array(l_brack); break; case 0x5C: write_slave_array(_bkslsh); break; case 0x5D: write_slave_array(r_brack); break; case 0x5E: write_slave_array(_pyramid); break; case 0x5F: write_slave_array(_underln); break; case 0x60: write_slave_array(_l_apos); break; case 0x61: write_slave_array(_a); break; case 0x62: write_slave_array(_b); break; case 0x63: write_slave_array(_c); break; case 0x64: write_slave_array(_d); break; case 0x65: write_slave_array(_e); break; case 0x66: write_slave_array(_f); break; case 0x67: write_slave_array(_g); break; case 0x68: write_slave_array(_h); break; case 0x69: write_slave_array(_i); break; case 0x6A: write_slave_array(_j); break; case 0x6B: write_slave_array(_k); break; case 0x6C: write_slave_array(_l); break; case 0x6D: write_slave_array(_m); break; case 0x6E: write_slave_array(_n); break; case 0x6F: write_slave_array(_o); break; case 0x70: write_slave_array(_p); break; case 0x71: write_slave_array(_q); break; case 0x72: write_slave_array(_r); break; case 0x73: write_slave_array(_s); break; case 0x74: write_slave_array(_t); break; case 0x75: write_slave_array(_u); break; case 0x76: write_slave_array(_v); break; case 0x77: write_slave_array(_w); break; case 0x78: write_slave_array(_x); break; case 0x79: write_slave_array(_y); break; case 0x7A: write_slave_array(_z); break; case 0x7B: write_slave_array(_l_brace); break; case 0x7C: write_slave_array(_bar); break; case 0x7D: write_slave_array(_r_brace); break; case 0x7E: write_slave_array(_tilde); break; case 0x7F: write_slave_array(_arrow); break; default: write_slave_array(_blank); break; } }
  9. Ian when the flare and chaff count gets to 50 and the "LOW"signal is displayed the counts are not displayed anymore on the osram display. They continue to display in the sim but it looks like the lua code is not sending anything but "LOW" all the way down to zero(maybe fault of my glue code). I also get a N\A (null character?)when the chaff and flare counts zero out. the cmsp mode looks flaky at times displaying wrong letters. Notice the modes do not have underlines thats not part of the displays built in character set. [ame] [/ame]
  10. Thanks Ian got her running with fresh Arduino install I guess I was saving sketches in wrong file.Short vid of display this is really designed for the CMSC so I'm on to that. [ame] [/ame]
  11. Your right its probably not wiring as I cant get a simple led master caution or ejection seat not armed to light. I'm noob to arduino I flash on my laptop and on my desktop no joy must be something simple staring me in the face but I aint gettin it.
  12. PDSP display Thanks for the help Ian The board is the Arduino Mega 2560 I do display digits from non data receiving function before the loop starts. I am using dcsbios v0.5.0 I see the cmd window with data streaming but no character changes. Will recheck wiring if you see no problem in code. /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" void onUhfFrequencyChange(char* newValue) { /* your code here */ while(*newValue>0){ _write_to_digit_zero(*newValue++); _write_to_digit_one (*newValue++); _write_to_digit_two (*newValue++); _write_to_digit_three(*newValue++); _write_to_digit_four(*newValue++); _write_to_digit_five(*newValue++); _write_to_digit_six (*newValue++); _write_to_digit_seven(0x20);//writes blank to eight display digit //since <string> is seven chars? } } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); /*assign Display pins to Arduino pins*/ int _reset = 3; int _FL = A0; int _A0 = A1; int _A1 = A2; int _A2 = A3; int _A3 = A4; int _A4 = A5; int _WR = 4; int _CE = 28; int _RD = 26; void setup() { DcsBios::setup(); /*Set direction MCU pins for controlling Display*/ pinMode(5,OUTPUT); /*LED heartbeat*/ pinMode(_reset,OUTPUT); pinMode(_FL,OUTPUT); pinMode(_A0,OUTPUT); pinMode(_A1,OUTPUT); pinMode(_A2,OUTPUT); pinMode(_A3,OUTPUT); pinMode(_A4,OUTPUT); pinMode(_WR,OUTPUT); pinMode(_CE,OUTPUT); pinMode(_RD,OUTPUT); DDRK = 0xFF; /*data bus direction*/ PORTK = 0x00; /*data bus initial value*/ _my_Reset(); /*Reset the Display*/ delay(500); /* Test write to display not using DCS data*/ _write_to_digit_zero (0x20); _write_to_digit_one (0x30); _write_to_digit_two (0x32); _write_to_digit_three (0x32); _write_to_digit_four (0x32); _write_to_digit_five (0x32); _write_to_digit_six (0x32); _write_to_digit_seven (0x32); delay(2000); } void loop() { DcsBios::loop(); /* Heartbeat LED is board accepting flash*/ digitalWrite(5, HIGH); // turn the LED on delay(1000); // wait for a second digitalWrite(5, LOW); // turn the LED off delay(1000); // wait for a second } /* Reset the Display ...clears character RAM * Flash RAM... resets internal counters */ void _my_Reset(void) { digitalWrite(_reset,LOW); delay(1); digitalWrite(_reset,HIGH); delay(400); } void _my_WR(void) { digitalWrite(_WR,HIGH); delay(1); digitalWrite(_WR,LOW); delay(1); digitalWrite(_WR,HIGH); } /* This Function writes to far left hand digit on Display*/ void _write_to_digit_zero(char my_ascii) { digitalWrite(_CE,LOW); //Chip enable digitalWrite(_RD,HIGH); //not used digitalWrite(_FL,HIGH); //Always high to write char digitalWrite(_A4,HIGH); //ignored digitalWrite(_A3,HIGH); //ignored digitalWrite(_A2,LOW); //next three set digitalWrite(_A1,LOW); //what display digitalWrite(_A0,LOW); //digit ascii char gets displayed on delay(1); PORTK = my_ascii; //data bus ascii character sent over this port delay(1); _my_WR(); //write function drops write pin low then high to write to display } void _write_to_digit_one(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,LOW); digitalWrite(_A1,LOW); digitalWrite(_A0,HIGH); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } void _write_to_digit_two(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,LOW); digitalWrite(_A1,HIGH); digitalWrite(_A0,LOW); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } void _write_to_digit_three(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,LOW); digitalWrite(_A1,HIGH); digitalWrite(_A0,HIGH); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } void _write_to_digit_four(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,HIGH); digitalWrite(_A1,LOW); digitalWrite(_A0,LOW); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } void _write_to_digit_five(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,HIGH); digitalWrite(_A1,LOW); digitalWrite(_A0,HIGH); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } void _write_to_digit_six(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,HIGH); digitalWrite(_A1,HIGH); digitalWrite(_A0,LOW); delay(1); PORTK = my_ascii; delay(1); _my_WR(); } /* Last digit on Display far right*/ void _write_to_digit_seven(unsigned char my_ascii) { digitalWrite(_CE,LOW); digitalWrite(_RD,HIGH); digitalWrite(_FL,HIGH); digitalWrite(_A4,HIGH); digitalWrite(_A3,HIGH); digitalWrite(_A2,HIGH); digitalWrite(_A1,HIGH); digitalWrite(_A0,HIGH); delay(1); PORTK = my_ascii; delay(1); _my_WR(); }
  13. onUhfFrequencyChange I am using an Osram pdsp1883 eight digit display(data sheet below) to display the uhf radio display. I dont quite understand how to use the onFrequencyChange function. How do I display the string properly? Do I reset the pointer when I hit the "\n" char? Does this onUhfFreqChange function write a single char everytime it is called? Do I make my own string buffer and read from that? Heres my attempt at reading the uhf string void onUhfFrequencyChange(char* newValue) { /* your code here */ while(*newValue>0) { _write_to_digit_zero(*newValue++); _write_to_digit_one(*newValue++); _write_to_digit_two(*newValue++); _write_to_digit_three(*newValue++); _write_to_digit_four(*newValue++); _write_to_digit_five(*newValue++); _write_to_digit_six(*newValue++); _write_to_digit_seven(0x20);//writes blank to eight display digit //since <string> is seven chars? } } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); /* This method writes an ascii digit to the first digit on display the other digits are the same except for address change A0-A2 pins */ void _write_to_digit_zero(char my_ascii) { digitalWrite(_CE,LOW);//Chip enable digitalWrite(_RD,HIGH);//not used digitalWrite(_FL,HIGH);//Always high to write char digitalWrite(_A4,HIGH);//ignored digitalWrite(_A3,HIGH);//ignored digitalWrite(_A2,LOW);//next three set digitalWrite(_A1,LOW);//what display digitalWrite(_A0,LOW);//digit ascii char gets displayed on delay(1); PORTK = my_ascii;//data bus delay(1); _my_WR();//write function drops write pin low then high to write to display } [ame=http://www.mouser.com/ds/2/311/00036139_0-280291.pdf]http://www.mouser.com/ds/2/311/00036139_0-280291.pdf[/ame]
  14. Heres a quick vid using Dead Frog Studios excellent tutorial on extracting data from DCS World A10. This is Dead Frog Studios software not mine I'm just showing what I learned I'm not an expert in any way. I extract the missile launch light data as opposed to the master caution used in the tutorial. If any one knows hoe to get the chaff and flare counts please add that to this thread so we can all learn. Tnx
  15. Latest update "connection interupted" ver 1.2432567854398
  16. Did the update tonight and now MP is highly unstable. Lost connection 4 times. Server changed mission in editor still disconnected. MP is becoming more unstable with these updates.
  17. This thing is huge and lots of detail. Good for mission planning. http://store.usgs.gov/b2c_usgs/catalog/query/(isQuery=yes&xcm=r3standardpitrex_prd&citemprod=000000000000206452&query=*nevada+test+and+training+range*&citemarea=0000001726&layout=6_1_61_59&uiarea=2&ctype=areaDetails&carea=0000000009&citem=00000017260000000071)/.do?lastVisited=areaDetails&query=*nevada+test+and+training+range
  18. Easy flight this Sat 11AM EST June 30 2012. Mixed loadout Mavs GBU's Jdams Willie Petes. Practice basic 9 line. Multiple targets buildings static tanks nothing fancy. email me for teamspeak info. dcsnellis at gmail dot com nice vid,heavy editing
  19. New 422 Test and Evaluation squadron will be based out of Nellis when Nellis/NTTR scenery released. We are an arm of the SimAir Force a Vatsim based VSOA.We offer live ATC/FAC/GCI and are in the squadron forming stages now. NO experience required. Requirements: Complete JPATS/SUPT in the T6/T38 in FSX then transition to DCS A10. See the SimAF website http://www.simairforce.org/forum/index.php?topic=966.0
×
×
  • Create New...