Basic Examples

AMB21/AMB22 Supported ARDUINO built-in example table

There are many built-in examples in Arduino. In the table below, we list all examples that are compatible with Ameba.

Please refer to the following link to set up Ameba for Arduino IDE:
Please refer to the following link for Arduino built-in example details:

Category

Name

Comment

Remarks

01. Basics

AnalogReadSerial

Connect potentiometer to 3.3V.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

BareMinimum

Blink

Pin LED_BUILTIN sets to pin D8.

DigitalReadSerial

Fade

ReadAnalogVoltage

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

02. Digital

BlinkWithoutDelay

Pin LED_BUILTIN sets to pin D8.

Button

Connect LED to pin D13.

Debounce

Connect LED to pin D13.

Digital InputPullup

Connect LED to pin D13.

StateChange Detection

Connect LED to pin D13.

toneKeyboard

toneMelody

toneMultiple

tonePitch Follower

03. Analog

Analog InOutSerial

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

AnalogInput

Connect LED to pin D13.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

Analog Write Mega

Calibration

Connect another LED to pin D13.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

Fading

Smoothing

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

04. Communication

ASCIITable

Dimmer

Graph

Connect potentiometer to 3.3V.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

Midi

Use Serial1 and pin D26, or use Serial2 and pin D17.

MultiSerial

PhysicalPixel

Read ASCIIString

SerialCallResponse

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

SerialCallResponse ASCII

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

SerialEvent

Serial Passthrough

Serial options, Serial1 or Serial2.

Virtual ColorMixer

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

05. Control

Arrays

Use pins D1, D2, D3, D4, D5, D6.

ForLoop Iteration

Use pins D1, D2, D3, D4, D5, D6.

IfStatement Conditional

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

switchCase

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

switchCase2

Use pins D1, D2, D3, D4, D5, D6.

While Statement Conditional

Connect another LED to pin D13.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

06. Display

barGraph

Use another pin to replace pin D7.

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

RowColumn Scanning

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

07. Strings

Character Analysis

StringAddition Operator

StringAppend Operator

String CaseChanges

String Characters

StringComparision Operators

ADC pin options A0, A1, A2, A3, A4, A5 and A6. ADC pin reading voltage range 0 to 3.3V.

StringIndexOf

StringLength

StringLengthTrim

StringReplace

StringStartsWith EndsWith

StringSubstring

StringToInt