基本範例

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

Category

Name

Comment

  1. Basics

AnalogReadSerial

Connect potentiometer to 3.3V

BareMinimum

Blink

Connect LED to pin 8

DigitalReadSerial

Fade

ReadAnalogVoltage

ADC can read a maximum of 3.3V.

  1. Digital

BlinkWithoutDelay

Connect LED to pin 8

Button

Connect LED to pin 13

Debounce

Connect LED to pin 13

DigitalInputPullup

Connect LED to pin 13

StateChangeDetection

Connect LED to pin 13

toneKeyboard

toneMelody

toneMultiple

tonePitchFollower

  1. Analog

AnalogInOutSerial

AnalogInput

Connect LED to pin 13

Analog Write Mega

Calibration

Connect another LED to pin 13

Fading

Smoothing

  1. Communication

ASCIITable

Dimmer

Use serial baud rate 115200

Graph

Use serial baud rate 115200, Connect potentiometer to 3.3V

Midi

Please use Serial1 and pin 26, or use Serial2 and pin 17

MultiSerial

PhysicalPixel

Use serial baud rate 115200

ReadASCIIString

SerialCallResponse

Use serial baud rate 115200

Se rialCallResponseASCII

Use serial baud rate 115200

SerialEvent

SerialPassthrough

VirtualColorMixer

Use serial baud rate 115200

  1. Control

Arrays

Use pins 1, 2, 3, 4, 5, 6

ForLoopIteration

Use pins 1, 2, 3, 4, 5, 6

I fStatementConditional

switchCase

switchCase2

Whil eStatementConditional

Connect another LED to pin 13

  1. Display

barGraph

Use another pin to replace pin 7

RowColumnScanning

  1. Strings

CharacterAnalysis

S tringAdditionOperator

StringAppendOperator

StringCaseChanges

StringCharacters

Stri ngComparisonOperators

StringIndexOf

StringLength

StringLengthTrim

StringReplace

Str ingStartsWithEndsWith

StringSubstring

StringToInt