Click here to Skip to main content
15,906,816 members

Comments by mraaf (Top 16 by date)

mraaf 20-Mar-18 0:47am View    
Hello,
Any idea or tips?

Thanks
mraaf 14-Mar-18 0:23am View    
Well that's what I tried, I'm sure the sequence of producing the a cycle of quadrature is correct (A ON, B OFF -->shift 90deg--> A ON, B ON -->shift 90deg--> A OFF, B ON -->shift 90deg--> A OFF, B OFF), but there are variables such as shift timing (Sleep() in this case), cycle timer (OnTimer()) might need to fix or incorrectly manipulated.
mraaf 14-Mar-18 0:06am View    
Yes, I'm pretty sure I need to fix my coding
mraaf 16-May-17 3:14am View    
I'm using CString::GetAt() to get each character, not sure this is best way but the microcontroller seems to receive all bytes of the string.

CString strAllDigits, strDigit1, strDigit2, strDigit3, strDigit4, strDigit5;
unsigned char pData[5];

strAllDigits.Format("%.2f", dTT126); // 4.00 - 20.00

// Get 1st digit
strDigit1.Format("%c", strAllDigits.GetAt(0));
unsigned char* pDigit1 = (unsigned char*)strDigit1.GetBuffer(0); // 1st char
strDigit1.ReleaseBuffer();

// Get 2nd digit
strDigit2.Format("%c", strAllDigits.GetAt(1));
unsigned char* pDigit2 = (unsigned char*)strDigit2.GetBuffer(0); // 2nd char
strDigit2.ReleaseBuffer();

// Get 3rd digit
strDigit3.Format("%c", strAllDigits.GetAt(2));
unsigned char* pDigit3 = (unsigned char*)strDigit3.GetBuffer(0); // 3rd char
strDigit3.ReleaseBuffer();

// Get 4th digit
strDigit4.Format("%c", strAllDigits.GetAt(3));
unsigned char* pDigit4 = (unsigned char*)strDigit4.GetBuffer(0); // 4th char
strDigit4.ReleaseBuffer();

// Get 5th digit
if(strlen(strAllDigits) > 4)
strDigit5.Format("%c", strAllDigits.GetAt(4));
unsigned char* pDigit5 = (unsigned char*)strDigit5.GetBuffer(0); // 5th char
strDigit5.ReleaseBuffer();

pData[0] = *pDigit1; // First ASCII character of data
pData[1] = *pDigit2; // Second ASCII character of data
pData[2] = *pDigit3; // Third ASCII character of data
pData[3] = *pDigit4; // Forth ASCII character of data
pData[4] = *pDigit5; // Fifth ASCII character of data

SDSWriteFIFO(Ident, (unsigned char*)pData);
mraaf 15-May-17 23:23pm View    
Thanks, try it before but it returns same result. It must be in SDSWriteFIFO() function itself.