This is a quickstart explanation of what Adafruit Arcada library provides, see the detailed Doxygen documents for arguments & return values
arcadaBegin()must be called first, it will set pin directions, turn off NeoPixels, and check for connected hardware
filesysBeginMSD()will initialize the storage method (SD or SPI flash) and check if a proper filesystem exists. On SD cards that's a FAT filesystem (so make sure its formatted). On SPI Flash we use CircuitPython's FAT filesystem, the best way to format is to load CircuitPython on once. If you're using TinyUSB as your USB stack, this will also make the disk drive appear on a computer
displayBegin()initializes the display, you will need to turn on the backlight after this is done - we don't do it for you!
readJoystickYread the analog joystick (if there is one) and returns -512 to 511 with 0 being 'center' (approximately)
readButtonsreturns a 32 bit mask for each button pressed at the moment of the function call - right now only the bottom 8 bits are used. Check
Adafruit_Arcada_Def.hfor the button mask names. Analog joysticks are checked against a threshold and 'emulate' a button press
Some boards, like the MONSTER M4SK and HalloWings, do not have a proper joystick - instead we will return the capacitive touch pads or buttons as if there was a joystick. For example, the M4SK's three buttons will return 'up', 'A' and 'down' respectively.
justPressedButtonswill tell you buttons were pressed as of the
- Ditto for
- Enable/disable speaker amplifier (if there is one) with
enableSpeaker- this doesn't affect headphones if there are any
readBatterySensorreturns the battery voltage detected. You cannot detect whether a battery is being charged, only the voltage.
readLightSensorwill return 0 for dark, 1023 for bright surrounding light.
setBacklightcan set the backlight from 0 (off) to 255 (all the way on)
These info boxes and alert display on the screen to let the user know something they need to do, get ready for, or went wrong. You can have the alert wait for a button press or have it return immediately (then you can delay or wait for something else to occur)
alertBoxis the generic, you can set the message, box and text color, as well as button press
alertBoxwhere the default button is A and the box color is white, text color is black
alertBoxwhere the default button is A and the box color is yellow, text color is black
alertBoxwhere the default button is A and the box color is red, text color is white
alertBoxwhere the box color is red, text color is white. It will sit in a busy loop and never return