Debugging with an ATtiny? I have an ATtiny hooked up to two line scan modules. I'm sending digital signals to the line scan modules then receiving the analog output and storing it in an array. I have an if statement that will make the LED on the ATtiny programmer blink when the number are below a certain range (meaning that lens is covered). 

Here is my code:

#include &lt;SoftwareSerial.h&gt;
const int rx=0;
const int tx=1;

SoftwareSerial mySerial(rx,tx);
int CLK = 2;
int SI = 1;
int Aout = A3; 
int Aout1 = A2;

int LED = 0;

int pixelsArray[128];   //Array to hold the values of the individual pixles.
int pixelsArray1[128];

 void outputPixels()
{
  for(int j = 0; j &lt; 128; j++)
  {
    digitalWrite(LED, LOW);

    if(pixelsArray[j] &lt; 100)
    {
      digitalWrite(LED, HIGH);
      delay(500);
      digitalWrite(LED, LOW);
      delay(500);
    }
  }
}


The problem that I am having is that when I test my code with one line scan module it works just fine. You will notice that in the readPixels() I have the statement pixelsArray1[i]=analogRead(Aout1); commented out. However, when I try to use it with two the LED start blinking regardless of how much light is hitting the line scanner.

The strange thing is that EVEN when I comment out the digitalWrite(LED, HIGH); statement in the outputPixels() method...THE LED STILL BLINKS!!!

Since the ATtiny does not support URT and can't use the console in Arduino I have no idea how to debug this. Does anyone here have any clue what is wrong?

Here is the datasheets

ATtiny: http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf

ATtiny Programmer: https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/?_ga=1.59946280.467360091.1464906372
Since you do not have enough RAM for your arrays, something has to
give. A few options:


Do you really need the 10-bit precision of the ADC? If you can live
with 8 bits, then use 8-bit arrays (type uint8_t) and store only
the 8 most significant bits of each reading
(pixelsArray[i]=analogRead(Aout)&gt;&gt;2). This will make the arrays
half as big.
If you really need 10-bit precision, maybe you do not need 128-pixel
resolution? Then you could store only every other pixel. This will
also halve the array sizes.
If you do need both the full precision and the full resolution, then
you will have to pack the bits tight. You can pack up to 4 readings
in 5 bytes. But this will increase the complexity of your program.


Addendum: To declare the arrays as being made of 8-bit integers,
just replace

int pixelsArray[128];
int pixelsArray1[128];


by

uint8_t pixelsArray[128];
uint8_t pixelsArray1[128];


Here “uint8_t” means “unsigned 8-bit integer”, whereas “int” is a
regular integer, i.e. signed and, on the AVRs, 16-bits long.