Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hello,
Here's the Getting Started for Processing: **broken link removed**
Very straightforward, I'm also reading and trying this now.
while(1) // endless Loop
{
ch='a';
HSerout(ch);//for testing uart is working
for(char t=0;t<6;t++){
c[t]= HSerin();
}
for(char t=0;t<5;t++) {
ch=c[t];
HSerout(ch); //sending back the data
}
}
while(1) // endless Loop
{
ch='a';
HSerout(ch);//for testing uart is working
for(char t=0;t<6;t++){
*c++= HSerin();
}
for(char t=0;t<5;t++) {
ch=*c++;
HSerout(ch); //sending back the data
}
}
yes but how to set it at initial position??The code where you use pointer starts always from the point where it left the last time.
for(char t=0;t<5;t++) {
ch=c[t];
HSerout(ch); //sending back the data
}
for(char t=0;t<5;t++) {
ch=*c++;
HSerout(ch); //sending back the data
}
yes but how to set it at initial position??
because i want to use pointer and save memory....Why don't you just use indexing?
??How do you set it to initial position the first time? How do you get the pointer?
Leave optimization to the compiler. Usually when a programmer starts "optimizing" his code, he actually makes it worse. Writing good readable code produces much better results most of the time. Modern compilers are very good at optimizing code...
char *temp;
temp = c;
for(char t=0;t<5;t++) {
ch=*temp++;
HSerout(ch); //sending back the data
}
for(char t=0;t<5;t++) {
ch=*c++;
HSerout(ch); //sending back the data
}
c = c-4;
You need to re-define the pointer every time before going into the loop. You need an extra variable for that.
Can you explain me bit more its working?
char *temp; // Temporary pointer that we will use inside the loop.
temp = c; // Set the pointer at the beginning
for(char t=0;t<5;t++) {
ch=*temp++; // Increment the pointer and get the character from that position
HSerout(ch); //sending back the data
}