I find that most of programmers do not use the boolean data type. If i know that my data can be 0 or 1, if i use boolean i will save memory but still it is not used much. What are the disadvantages?
Type: Posts; User: Clearner123
I find that most of programmers do not use the boolean data type. If i know that my data can be 0 or 1, if i use boolean i will save memory but still it is not used much. What are the disadvantages?
#include <stdio.h>
int main()
{
int number=0;
char digit=0;
while(1)
{
printf("Enter the digit\n");
scanf("%c",&digit);
#include <stdio.h>
int main()
{
int number=0;
char digit=0;
while(1)
{
printf("Enter the digit\n");
scanf("%c",&digit);
I am really sorry how that mistake happened. I will try with the changes.
Write a function int convert () that reads a decimal number one character(digit) at a time, terminated by a blank, and returns the value of that number.
I am trying to write program for above
...
I have written the following code to identify the end of array
#include <stdio.h>
unsigned int array[20]={21,22,23,12,1,0,6,7,'\0'};
int main()
{
// Write C code here
unsigned int...
Hi,
I need to transmit data over CAN, but i am really struggling to organize the software flow. The below is the prototype function to transmit
void CanTransmit(uint8_t *TxData)
{
}
The...
I am struggling to write the logic for CAN message timeout. I am trying to avoid global variables, i have added the attachment, please advise me a good method. I also need to check the message...
I have been assigned to review the below code and update for the changes.
if(condition1>val1 && condition2<=val2 && cond3>val3 && cond4<val4 && cond5==val5 && cond6==val6 && cond7==val7 &&...
Hi,
Need some advice, I need to do a USB write blocker software, I wanted to know how complicated it is? Which programming language to use? I have never done this kind of programming. Please help.
I am referring to a micro controller based embedded C programming. Most of the time the processor i am working with has very limited time, where the number of tasks are more, for example
a. Analog...
i have a function
void SendData(sint32_t data)
{
Transmit();
}
One problem i am seeing is i need to send data of max size of uint32_t and also a function requiring to transmit a data...
Yes I receive data, I had problems receiving for higher values, then I figured one mistake of argument, I defined as uint instead of the signed. I am having difficulty in transmitting new line hence...
I have multiple doubts, hopefully i can get clarified here
int16 datatotransmit[100];
int main()
{
while (index <= 90) /*transmitting 90 elements of datatotransmit array */
{
Why do you think so, any reason?
I am getting really confused now, if i have a signed value for example -634, what will the MSB and LSB of the number?
I want to transmit a variable over UART and also LCD, the UART is a generated function with argument of uint8_t, the data i need to transmit is both signed and unsigned and it is 16 bit. How do i...
I hope, this is what you mean?
void Rms(uint16 rawcount_16)
{
uin32_t l_temp_square_u32=0;
int32_t l_temp_offset_s32=(int32_t)rawcount_16;
l_temp_offset_s32 -= 512;
l_temp_square_u32 =...
Ok one point i forgot to mention is that rawcount can be maximum is 1024.
Ok i understand now it shall be like this
void Rms(uint16 rawcount_u16)
{
uint16_t l_temp_rawcount_u16 = 0;
uint32_t l_temp_square_u32=0;
int32_t l_temp_offset_s32 =0;
l_temp_rawcount_u16 ...
I tried with the following code
void Rms(uint16 rawcount)
{
uint16_t l_temp_rawcount_u16 = 0;
uint32_t l_temp_square_u32 = 0;
int16_t l_temp_offset_s16 = 0;
l_temp_rawcount_u16 =...
I am trying to calculate the RMS value, but i need to offset by 512,
I get the raw value from 0 to 1024, i need subtract 512 from this number and then square the number, but i get warnings
...
I saw the code
typedef signed int SFRAC16;
#define Q15(Float_Value) \
((Float_Value < 0.0) ? (SFRAC16)(32768 * (Float_Value) - 0.5) \
: (SFRAC16)(32767 * (Float_Value) +...
I have seen this type declaration. Can someone explain me this
typedef unsigned int uint16;
typedef uint16 Buf[32][8];
Buf buf1;
I slightly modified the variable names....
I am facing serious problem of understanding and confusion of Motorola and Intel formats. My requirement is I have to transmit 8 bytes of data using CAN communications it is serial communication....