I think that if I "bit-pack" I have to add some kind of "separators" too
Analogue conversion rate is about 10kHz, so consecutive samples should be about 100uS (0.1mS) apart.
I still can't figure out how convert int into 2 bytes then to spilt it & send data & merge in processing. (should I use an external library)
unsigned short readingA = analogRead (apin);unsigned short readingB = analogRead (bpin);Serial.print (readingA >> 8, BYTE);Serial.print (readingA & 0xFF, BYTE);Serial.print (readingB >> 8, BYTE);Serial.print (readingB & 0xFF, BYTE);
The Atmega168 datasheet also cautions against switching analog pins in close temporal proximity to making A/D readings (analogRead) on other analog pins. This can cause electrical noise and introduce jitter in the analog system. It may be desirable, after manipulating analog pins (in digital mode), to add a short delay before using analogRead() to read other analog pins.
the PIN register reads the state of INPUT pins set to input with pinMode()...PINB is the input register variable It will read all of the digital input pins at the same time. Sometimes you might need to set multiple output pins at exactly the same time. Calling digitalWrite(10,HIGH); followed by digitalWrite(11,HIGH); will cause pin 10 to go HIGH several microseconds before pin 11, which may confuse certain time-sensitive external digital circuits you have hooked up. Alternatively, you could set both pins high at exactly the same moment in time using PORTB |= B1100;
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16