how do i make it accept the binary data using the stream , in an array and then in a for loop it will turn on 3 led's
What is it?
Which stream?
Do you realise that no one can answer your question unless they are a wizard with crystal ball?
May be if you speak very very gently to your arduino it will work? They have sometimes a life of their own
If it does not work, then some programming might be required and it usually starts with functional and detailed specifications
if you just want to turn on 3 LEDs, why do you need a "for loop", wouldn't you just turn the LEDs on?
presumably by "stream" you mean serial interface and the IDEs serial monitor. does it mater what you receive or simply that when you receive something the LEDs are turned on?
do you want to be able to turn the LEDs off? do you want different serial commands to turn specific LEDs on or off?
all data is binary. binary values represent asciicharacters. what about using different ascii characters to turn different LEDs on/off?
pin_s1 = 13
pin_s2 = 12
pin_s3 = 11
void loop{
stream_s1=[10111010]
stream_s2=[10001010]
stream_s3=[10011010]
}
here enters the for loop
you will have something example friend
It’s very far from being clear..
Can you explain in plain English
- what do you call a stream?
- where are those 0 and 1 coming from?
- are they pin status (LOW, HIGH) that you sample from designated pins, are they ASCII chars coming from Rx pins of Serial interfaces, etc?
- draw a picture of your system and circuit and post it here
also, do yourself a favour and please read How to get the best out of this forum and post accordingly (including code tags for code and necessary documentation for your modules).
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.