I am struggling on how to get an analog output from a serial message

I have spent all the afternoon trying but no luck at all…

Here is the code that I have written:

int test;
void setup()
{
Serial.begin(9600);
}

void loop(){
while (serialAvailable()){
test = serialRead(); //read Serial
serialWrite(test);
analogWrite(9,test);
}
}

For some reason the analogWrite function does not want to read the test variable value which is the one that I send through serial communication.

I have written an help request on the Arduino forum, let’s see how it goes.

Here is the link to the Arduino Forum Thread: Link

Let me cross my fingers…

No Comments

No comments yet.

Comments RSS

Sorry, the comment form is closed at this time.