Features:
Windows 10, Full touch screen support, Intel m5 proccessor, 4GB RAM, 64GB SSD, 2k LCD, Bluetooth, WiFi, 128GB SD Card, Battery monitor software with automatic shut down function, Joysticks RGB lights switched with TV button.
Build materials:
Intel Core M vPro STK2MV64CC stick
Topfoison 2560*1440 1440p 2k ips lcd panel
7.2V 4000mAh battery
POLOLU-2865 Pololu 5V, 6A Step-Down Voltage Regulator D24V60F5
POLOLU-2813 Big Pushbutton Power Switch
Teensy 2.0++ USB AVR Development Board
2S 8A 7.4V Lithium Li-ion Battery Cell BMS
USB DAC Sound card
Stereo Amplifier
TP5100 2A battery charger module
Youtube video:
https://www.youtube.com/watch?v=4SFRtmE0mxg&t=65s
https://www.youtube.com/watch?v=WdmV7iIXdI0
Pictures:
Teensy code:
Code: Select all
long previousMillis = 0;
long interval = 1000;
//BATTERY MONITOR
//float refVcc = 5.0;
//BUTTONS
const int DOWN_BUTTON = 29;
const int UP_BUTTON = 30;
const int LEFT_BUTTON = 31;
const int LB_BUTTON = 33;
const int LT_BUTTON = 34;
const int RIGHT_BUTTON = 35;
const int X_BUTTON = 4;
const int A_BUTTON = 5;
const int RT_BUTTON = 7;
const int RB_BUTTON = 8;
const int B_BUTTON = 9;
const int MINUS_BUTTON = 10;
const int PLUS_BUTTON = 11;
const int Y_BUTTON = 12;
const int LEFT_CLICK = 32;
const int RIGHT_CLICK = 28;
const int HOME_BUTTON = 20; // WINDOWS BUTTON
const int TV_BUTTON = 21; //LED MODE BUTTON
//ANALOG
const int LEFT_VER = 45;
const int LEFT_HOR = 44;
const int RIGHT_VER = 43;
const int RIGHT_HOR = 42;
//RGB LED
const int RLED_LEFT=14;
const int GLED_LEFT=15;
const int BLED_LEFT=16;
const int RLED_RIGHT=26;
const int GLED_RIGHT=25;
const int BLED_RIGHT=24;
//STATUS LED
const int HOME_RED = 22;
const int HOME_BLUE = 23;
const int LOW_LED = 13;
//COMPUTESTICK LED
int OFF = 39;
int val = 0;
boolean lastButton = HIGH;
boolean currentButton = LOW;
int LEDMODE = 0;
const int numButtons = 18;
byte allButtons[numButtons];
byte indexButtonPins[numButtons] = {UP_BUTTON, DOWN_BUTTON, LEFT_BUTTON, RIGHT_BUTTON, A_BUTTON, B_BUTTON, X_BUTTON, Y_BUTTON, MINUS_BUTTON, PLUS_BUTTON, LB_BUTTON, LT_BUTTON, RB_BUTTON, RT_BUTTON, LEFT_CLICK, RIGHT_CLICK, HOME_BUTTON, TV_BUTTON};
void setup() {
Serial.begin(9600);
Joystick.useManualSend(true);
pinMode(UP_BUTTON, INPUT_PULLUP);
pinMode(DOWN_BUTTON, INPUT_PULLUP);
pinMode(LEFT_BUTTON, INPUT_PULLUP);
pinMode(RIGHT_BUTTON, INPUT_PULLUP);
pinMode(A_BUTTON, INPUT_PULLUP);
pinMode(B_BUTTON, INPUT_PULLUP);
pinMode(X_BUTTON, INPUT_PULLUP);
pinMode(Y_BUTTON, INPUT_PULLUP);
pinMode(MINUS_BUTTON, INPUT_PULLUP);
pinMode(PLUS_BUTTON, INPUT_PULLUP);
pinMode(LB_BUTTON, INPUT_PULLUP);
pinMode(LT_BUTTON, INPUT_PULLUP);
pinMode(RB_BUTTON, INPUT_PULLUP);
pinMode(RT_BUTTON, INPUT_PULLUP);
pinMode(LEFT_CLICK, INPUT_PULLUP);
pinMode(RIGHT_CLICK, INPUT_PULLUP);
pinMode(HOME_BUTTON, INPUT_PULLUP);
pinMode(TV_BUTTON, INPUT_PULLUP);
pinMode (RLED_LEFT, OUTPUT);
pinMode (GLED_LEFT, OUTPUT);
pinMode (BLED_LEFT, OUTPUT);
pinMode (RLED_RIGHT, OUTPUT);
pinMode (GLED_RIGHT, OUTPUT);
pinMode (BLED_RIGHT, OUTPUT);
pinMode (HOME_RED, OUTPUT);
pinMode (HOME_BLUE, OUTPUT);
pinMode (LOW_LED, OUTPUT);
pinMode (OFF, INPUT);
}
boolean debounce(boolean last)
{
boolean current = digitalRead(TV_BUTTON);
if (last != current)
{
delay(20);
current = digitalRead(TV_BUTTON);
}
return current;
}
void setMode(int mode)
{
//RED
if (mode == 1)
{
digitalWrite(RLED_LEFT, LOW);
digitalWrite(GLED_LEFT, HIGH);
digitalWrite(BLED_LEFT, HIGH);
digitalWrite(RLED_RIGHT, LOW);
digitalWrite(GLED_RIGHT, HIGH);
digitalWrite(BLED_RIGHT, HIGH);
}
//GREEN
else if (mode == 2)
{
digitalWrite(RLED_LEFT, HIGH);
digitalWrite(GLED_LEFT, LOW);
digitalWrite(BLED_LEFT, HIGH);
digitalWrite(RLED_RIGHT, HIGH);
digitalWrite(GLED_RIGHT, LOW);
digitalWrite(BLED_RIGHT, HIGH);
}
//BLUE
else if (mode == 3)
{
digitalWrite(RLED_LEFT, HIGH);
digitalWrite(GLED_LEFT, HIGH);
digitalWrite(BLED_LEFT, LOW);
digitalWrite(RLED_RIGHT, HIGH);
digitalWrite(GLED_RIGHT, HIGH);
digitalWrite(BLED_RIGHT, LOW);
}
//PURPLE (RED+BLUE)
else if (mode == 4)
{
analogWrite(RLED_LEFT, 127);
analogWrite(GLED_LEFT, 255);
analogWrite(BLED_LEFT, 127);
analogWrite(RLED_RIGHT, 127);
analogWrite(GLED_RIGHT, 255);
analogWrite(BLED_RIGHT, 127);
}
//TEAL (BLUE+GREEN)
else if (mode == 5)
{
analogWrite(RLED_LEFT, 255);
analogWrite(GLED_LEFT, 127);
analogWrite(BLED_LEFT, 127);
analogWrite(RLED_RIGHT, 255);
analogWrite(GLED_RIGHT, 127);
analogWrite(BLED_RIGHT, 127);
}
//ORANGE (GREEN+RED)
else if (mode == 6)
{
analogWrite(RLED_LEFT, 50);
analogWrite(GLED_LEFT, 127);
analogWrite(BLED_LEFT, 255);
analogWrite(RLED_RIGHT, 50);
analogWrite(GLED_RIGHT, 127);
analogWrite(BLED_RIGHT, 255);
}
//WHITE (GREEN+RED+BLUE)
else if (mode == 7)
{
analogWrite(RLED_LEFT, 0);
analogWrite(GLED_LEFT, 0);
analogWrite(BLED_LEFT, 50);
analogWrite(RLED_RIGHT, 0);
analogWrite(GLED_RIGHT, 0);
analogWrite(BLED_RIGHT, 50);
}
//OFF (mode = 0)
else
{
digitalWrite(RLED_LEFT, HIGH);
digitalWrite(GLED_LEFT, HIGH);
digitalWrite(BLED_LEFT, HIGH);
digitalWrite(RLED_RIGHT, HIGH);
digitalWrite(GLED_RIGHT, HIGH);
digitalWrite(BLED_RIGHT, HIGH);
}
}
void loop() {
int VOLTAGE = analogRead(A0);
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
Serial.println (VOLTAGE/4);
}
if (analogRead(A0) < 624)
{
digitalWrite(LOW_LED, HIGH);
}
else
{
digitalWrite(LOW_LED, LOW);
}
val = analogRead(OFF);
if (val <500)
{
digitalWrite(HOME_RED, LOW);
}
else
{
digitalWrite(HOME_RED, HIGH);
}
if (digitalRead(HOME_BUTTON) == LOW)
{
Keyboard.press(KEY_LEFT_GUI);
}
else
{
Keyboard.release(KEY_LEFT_GUI);
}
//digitalWrite(HOME_BLUE, HIGH);
//digitalWrite(LOW_LED, HIGH);
Joystick.X(map(analogRead(LEFT_HOR),215, 795, 0, 1023));
Joystick.Y(map(analogRead(LEFT_VER),235, 855, 1023, 0));
Joystick.sliderLeft(map(analogRead(RIGHT_HOR),210, 805, 1023, 0));
Joystick.sliderRight(map(analogRead(RIGHT_VER),195, 805, 0, 1023));
for (int i = 0; i < numButtons; i++) {
if (digitalRead(indexButtonPins[i])) {
allButtons[i] = 0;
} else {
allButtons[i] = 1;
}
Joystick.button(i + 1, allButtons[i]);
}
Joystick.send_now();
delay(10);
{
currentButton = debounce(lastButton);
if (lastButton == LOW && currentButton == HIGH)
{
LEDMODE++;
}
lastButton = currentButton;
if (LEDMODE == 8) LEDMODE = 0;
setMode(LEDMODE);
}
}