Parts of Sparki
A library reference for all parts of Sparki
Here's all the parts that make up Sparki! Click on a part for more information on how it works and how to use it. Each part also has a quick reminder reference below it for the commands that go along with it. Accelerometer
sparki.accelX(); sparki.accelY(); sparki.accelZ();Bluetooth Module
Serial1.read(); Serial1.print(); Serial1.println();Buzzer
sparki.beep(); sparki.beep(int freq); sparki.beep(int freq, int time);Expansion Port Gripper
sparki.gripperOpen(); sparki.gripperOpen(width_cm); sparki.gripperClose(); sparki.gripperClose(width_cm); sparki.gripperStop();Infrared LED
sparki.sendIR();Infrared Reflectance Sensor
sparki.edgeLeft(); sparki.lineLeft(); sparki.lineCenter(); sparki.lineRight(); sparki.edgeRight();Infrared Remote Infrared Remote Receiver
sparki.readIR();LCD
sparki.clearLCD(); sparki.updateLCD(); sparki.drawPixel(xPixel, yPixel); sparki.readPixel(xPixel, yPixe); sparki.drawChar(xPixel, yLine, char); sparki.drawString(xPixel, yLine, *char); sparki.drawLine(xStart, yStart, xEnd, yEnd); sparki.drawRect(xCenter, yCenter, width, heigh); sparki.drawRectFilled(xCenter, yCenter, width, height); sparki.drawCircle(xCenter, yCenter, radius); sparki.drawCircleFilled(xCenter, yCenter, radius); sparki.drawBitmap(xStart, yStart, *bitmap, width, height);Light Sensor
sparki.lightLeft(); sparki.lightCenter(); sparki.lightRight();Magnetometer
sparki.magX(); sparki.magY(); sparki.magZ();Marker Holder On/Off Switch Radio
radio.writeChar(char) radio.writeInt(int) radio.writeFloat(float) radio.readChar() radio.readInt() radio.readFloat() radio.available()Reset Button RGB LED
sparki.RGB(R,G,B);Status LED
digitalWrite(STATUS_LED, HIGH); digitalWrite(STATUS_LED, LOW); analogWrite(STATUS_LED, 0); analogWrite(STATUS_LED, 123); analogWrite(STATUS_LED, 255);Wheels
sparki.moveForward(distance_centimeters); sparki.moveBackward(distance_centimeters); sparki.moveLeft(angle_degrees); sparki.moveRight(angle_degrees); sparki.moveStop();Servo
sparki.servo(angle_degrees);Stepper Motors
sparki.motorRotate(int motor, int direction, int speed); sparki.motorStop(int motor);Ultrasonic Range Finder
sparki.ping();