Demo 1: Analog and Digital - Debugging Arduino Logic - Arduino Development for OSX and iOS (2015)

Arduino Development for OSX and iOS (2015)

5. Debugging Arduino Logic

5.3 Demo 1: Analog and Digital

In this demo, we try to measure digital and analog output on Arduino board. I use Ikalogic tool for testing.

5.3.1 Ika Logic Installation

You can download ScanaStudio from . Install and follow the installation process.


After finished, you can run ScanaStudio tool and select your tool model


Now you're ready to measure Arduino pins.

5.3.2 Wiring

In this demo, I use Arduino Uno so you can connect your Arduino to Ikalogic as follows.

· Digital pin 8 Arduino to channel 1 Ikalogic

· Analog A0 Arduino to channel 2 Ikalogic

· GND Arduino to channel GND Ikalogic

The following is my hardware wiring.


5.3.3 Writing Arduino Software

Now you can write a program for Arduino to simulate digital and analog output on Arduino pins.

Write these codes.

int digital_pin = 8;

int dac = 0;

void setup() {



void loop() {

analogWrite(A0, dac);

if(dac<50 || (dac>100 && dac <180) || dac>200)

digitalWrite(digital_pin, HIGH);


digitalWrite(digital_pin, LOW);

dac = dac + 10;


dac = 0;



Save and upload the program to Arduino board.

5.3.4 Testing

On ScanaStudio, we do the following configuration on Configure panel

· Trigger type : No trigger

· Sampling rate: 100 KHz

· N. of Samples: 261888

After configured, you can click Start button to retrieve inputs from Arduino board.

A sample output can be seen in Figure below.