ClearCore Library
ClearCore Arduino API Reference

Overview

The ClearCore Arduino Wrapper Library, used in conjunction with the standard ClearCore Motion and I/O Library, allows for easy programming in the lightweight Arduino IDE. Using ClearCore with the Arduino IDE is suitable for all developers, from confident Arduino users to novice programmers or even experienced programmers who want to create a prototype as quickly as possible.

This section serves as a reference guide for the ClearCore Arduino wrapper functions that can be used to control your ClearCore. Because this is a software wrapper, each of the functions within it interacts with the ClearCore Motion and I/O Library. As such, some of the functions you see here were modified from the original Arduino counterparts. Any differences from the standard Arduino functions are documented below as well.

ClearCore connector aliases
NameArduino Alias
ConnectorIO0
IO0
ConnectorIO1
IO1
ConnectorIO2
IO2
ConnectorIO3
IO3
ConnectorIO4
IO4
ConnectorIO5
IO5
ConnectorDI6
DI6
ConnectorDI7
DI7
ConnectorDI8
DI8
ConnectorA9
A9
ConnectorA10
A10
ConnectorA11
A11
ConnectorA12
A12
ConnectorUsb
Serial
ConnectorCOM0
Serial0
ConnectorCOM1
Serial1


ClearCore motor input aliases
NameArduino Alias
M-0 Input A
M0_INA
M-0 Input B
M0_INB
M-1 Input A
M1_INA
M-1 Input B
M1_INB
M-2 Input A
M2_INA
M-2 Input B
M2_INB
M-3 Input A
M3_INA
M-3 Input B
M3_INB


SDK Examples

As part of the Arduino installation package a number of examples sketches are included. These sketches demonstrate how to utilize the various features of ClearCore using standard Arduino functions and classes. The examples may be found in the Arduino IDE under the Examples menu, as seen below:

Deviations from standard Arduino

Global Types, Enumerators, and Objects

Pin Mode

Pin Status

Serial

Basic I/O

pinMode(pin, mode)

digitalRead(pin)

digitalWrite(pin, value)

analogRead(pin, units[optional])

analogWrite(pin, value, mode[optional], units[optional])

analogReadResolution(bits)

analogWriteResolution(bits)

analogReference(type)

Advanced I/O

tone(pin, frequency, duration[optional])

noTone(pin)

pulseIn(pin, value, timeout[optional])

pulseInLong(pin, value, timeout[optional])

Time

delay(ms)

delayMicroseconds(us)

millis()

micros()

Interrupts

ClearCore pins DI6 through A12 can be set up as digital interrupts.

attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)

detachInterrupt(pin)

interrupts()

noInterrupts()

Serial

Arduino.cc Reference

begin(speed, config[optional])

write(val)

print(val, format[optional])

println(val, format[optional])

read()

ttl(bool isTtl)

SPI

Arduino.cc Reference

SPISettings(speedMaximum, dataOrder, dataMode)

begin()

beginTransaction(mySettings)

transfer(val)

endTransaction()

Ethernet

Arduino.cc Reference

IPAddress()

begin(mac)

linkStatus()

External Reference

See official Arduino documentation at https://www.arduino.cc/reference/en.