UI Controls
onEvent
button
textInput
textLabel
dropdown
getText
setText
getNumber
setNumber
checkbox
radioButton
getChecked
setChecked
image
setImageURL
playSound
stopSound
open
getImageURL
showElement
hideElement
deleteElement
setPosition
setSize
getProperty()
setProperty()
write
getXPosition
getYPosition
setScreen
rgb()
playSpeech()
Canvas
createCanvas
setActiveCanvas
line
circle
rect
setStrokeWidth
setStrokeColor
setFillColor
drawImage
drawImageURL
getImageData
putImageData
clearCanvas
getRed
getGreen
getBlue
getAlpha
setRed
setGreen
setBlue
setAlpha
setRGB
Data
startWebRequest
setKeyValue
getKeyValue
createRecord
readRecords
updateRecord
deleteRecord
onRecordEvent
getPrediction
getUserId
drawChart
drawChartFromRecords
getColumn
createRecordSync
Turtle
moveForward
moveBackward
move
moveTo
dot
turnRight
turnLeft
turnTo
arcRight
arcLeft
getX
getY
getDirection
penUp
penDown
penWidth
penColor
penRGB
show
hide
speed
Control
For loop
While loop
If statement
If/else statement
getTime
timedLoop()
stopTimedLoop()
setTimeout
clearTimeout
setInterval
clearInterval
Math
Add Operator
Subtract operator
Multiply operator
Divide operator
Equality operator
Inequality operator
Greater than operator
Greater than or equal operator
Less than operator
Less than or equal operator
And Operator
Or operator
Not operator
randomNumber min/max
randomNumber
Math.round
Math.abs
Math.max
Math.min
Math.random
Math.sqrt
Math.pow
Modulo operator
Variables
Declare and assign a value to a variable
Declare a variable
Assign x
Prompt the user for a value and store it
Prompt the user for a numerical value and store it
console.log
Declare and assign a string to a variable
str.substring
indexOf
includes
length
str.toUpperCase
str.toLowerCase
list.length
list.join
insertItem
Declare and assign an array [1,2,3] to a variable
Declare and assign an array ["a", "b", "d"] to a variable
Declare and assign an array to a variable
appendItem
removeItem
Access List Item
Declare an object
getValue
addPair
Functions
Define a function
Define a function with parameters
Call a function
Call a function with parameters
return
Comment
Advanced
setStyle()
Maker
boardConnected
pinMode()
digitalWrite()
digitalRead()
analogWrite()
analogRead()
createLed()
createButton()
Circuit
onBoardEvent()
led
led.on()
led.off()
led.blink()
led.pulse()
led.toggle()
colorLeds
colorLeds[i].on()
colorLeds[i].blink()
colorLeds[i].toggle()
colorLeds[i].off()
colorLeds[i].pulse()
colorLeds[i].stop()
colorLeds[i].intensity()
colorLeds[i].color()
buzzer
buzzer.frequency()
buzzer.note()
buzzer.stop()
buzzer.play()
accelerometer
accelerometer.getOrientation
accelerometer.getAcceleration
toggleSwitch
toggleSwitch.isOpen
button(L/R)
buttonL.isPressed
buttonL.holdtime
soundSensor.threshold
soundSensor
lightSensor.threshold
lightSensor.value
lightSensor.start
soundSensor.value
soundSensor.setScale()
lightSensor
lightSensor.setScale()
tempSensor
tempSensor.C
tempSensor.F
soundSensor.getAveragedValue
lightSensor.getAveragedValue
buzzer.playNotes
buzzer.playSong
boardConnected
Category:
Maker
Syntax
boardConnected();
Found a bug in the documentation? Let us know at
documentation@code.org