OSD Battery Monitoring for Helder's AIO Boards
-
- Posts: 14
- Joined: Fri May 11, 2018 12:49 am
- Location: Rome, Italy
- Has thanked: 2 times
Re: OSD Battery Monitoring for Helder's AIO Boards
Thank again!
If i get it right i could leave it as it is since, from what i read, it is already set on A0.. there is no need to write in my pin number(21) right?
Also i will change led pin to 11(since that's my led pin) and probably get rid of pin 15 and 16 since if i read it correctly thet are not used in the original script..
If i get it right i could leave it as it is since, from what i read, it is already set on A0.. there is no need to write in my pin number(21) right?
Also i will change led pin to 11(since that's my led pin) and probably get rid of pin 15 and 16 since if i read it correctly thet are not used in the original script..
- Wailer
- Posts: 119
- Joined: Mon Jan 15, 2018 3:45 pm
- Location: Tiel, The Netherlands
- Has thanked: 30 times
- Been thanked: 38 times
Re: OSD Battery Monitoring for Helder's AIO Boards
A0 is indeed set as analog in in this sketch.
Correct 11 is free (in the sketch that is, the leonardo pro micro does not have a pin 11
) and 15/16 are not used.
Ah now i get it, you are using a teensy 2.0, this one got a lot more pins than a Pro Micro (mini arduino leonardo).
So you have to check wich pins the teensy uses for analog input (i have no teensy so i cannot tell you this) and change the A0 in analogRead(A0) into the pin number used by teensy.
Correct 11 is free (in the sketch that is, the leonardo pro micro does not have a pin 11

Ah now i get it, you are using a teensy 2.0, this one got a lot more pins than a Pro Micro (mini arduino leonardo).
So you have to check wich pins the teensy uses for analog input (i have no teensy so i cannot tell you this) and change the A0 in analogRead(A0) into the pin number used by teensy.
-
- Posts: 14
- Joined: Fri May 11, 2018 12:49 am
- Location: Rome, Italy
- Has thanked: 2 times
Re: OSD Battery Monitoring for Helder's AIO Boards
this is the code I changed. Unfortunatelly it doesn't compile... i also tried to compile the original script but it returns the same error ( to me it looks like a formatting error, indentation and brackets. i just copied and pasted the code in the other thread)
Arduino:1.8.5 (Windows 10), TD: 1.41, Scheda:"Teensy 2.0, Keyboard + Mouse + Joystick, 16 MHz, US English"
Opzioni di compilazione cambiate, ricompilo tutto
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino: In function 'void setup()':
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:37:1: error: 'Gamepad' was not declared in this scope
Gamepad.begin();
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino: In function 'void loop()':
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:47:3: error: 'Gamepad' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_CENTERED);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:47:17: error: 'GAMEPAD_DPAD_CENTERED' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_CENTERED);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:49:19: error: 'GAMEPAD_DPAD_DOWN' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:51:21: error: 'GAMEPAD_DPAD_DOWN_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:53:21: error: 'GAMEPAD_DPAD_DOWN_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_RIGHT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:56:19: error: 'GAMEPAD_DPAD_UP' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:58:21: error: 'GAMEPAD_DPAD_UP_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:60:21: error: 'GAMEPAD_DPAD_UP_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP_RIGHT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:63:19: error: 'GAMEPAD_DPAD_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:65:19: error: 'GAMEPAD_DPAD_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_RIGHT);
^
Errore durante la compilazione per la scheda Teensy 2.0.
Questo report potrebbe essere più ricco di informazioni abilitando l'opzione
"Mostra un output dettagliato durante la compilazione"
in "File -> Impostazioni"
Arduino:1.8.5 (Windows 10), TD: 1.41, Scheda:"Teensy 2.0, Keyboard + Mouse + Joystick, 16 MHz, US English"
Opzioni di compilazione cambiate, ricompilo tutto
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino: In function 'void setup()':
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:37:1: error: 'Gamepad' was not declared in this scope
Gamepad.begin();
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino: In function 'void loop()':
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:47:3: error: 'Gamepad' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_CENTERED);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:47:17: error: 'GAMEPAD_DPAD_CENTERED' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_CENTERED);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:49:19: error: 'GAMEPAD_DPAD_DOWN' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:51:21: error: 'GAMEPAD_DPAD_DOWN_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:53:21: error: 'GAMEPAD_DPAD_DOWN_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_RIGHT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:56:19: error: 'GAMEPAD_DPAD_UP' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:58:21: error: 'GAMEPAD_DPAD_UP_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:60:21: error: 'GAMEPAD_DPAD_UP_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_UP_RIGHT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:63:19: error: 'GAMEPAD_DPAD_LEFT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_LEFT);
^
C:\Users\marley\Desktop\GamepadNoAnalog-HID\GamepadNoAnalog-HID.ino:65:19: error: 'GAMEPAD_DPAD_RIGHT' was not declared in this scope
Gamepad.dPad1(GAMEPAD_DPAD_RIGHT);
^
Errore durante la compilazione per la scheda Teensy 2.0.
Questo report potrebbe essere più ricco di informazioni abilitando l'opzione
"Mostra un output dettagliato durante la compilazione"
in "File -> Impostazioni"
Code: Select all
#include "HID-Project.h"
#define NUM_BUTTONS 17
#define BTN_UP 0
#define BTN_DOWN 1
#define BTN_LEFT 2
#define BTN_RIGHT 3
#define BTN_A 4
#define BTN_START 5
#define BTN_Y 6
#define BTN_L1 7
#define BTN_X 8
#define BTN_R1 9
#define BTN_B 10
#define BTN_SELECT 12
const int ledPin = 11;
int ledState = LOW;
unsigned long previousMillis = 0;
const long interval = 1000;
char i;
void setup()
{
pinMode(0, INPUT_PULLUP);
pinMode(1, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(11, OUTPUT);
Gamepad.begin();
Serial.begin(115200);
}
void loop()
{
bool down = !digitalRead(BTN_DOWN);
bool up = !digitalRead(BTN_UP);
bool left = !digitalRead(BTN_LEFT);
bool right = !digitalRead(BTN_RIGHT);
Gamepad.dPad1(GAMEPAD_DPAD_CENTERED);
if(down) {
Gamepad.dPad1(GAMEPAD_DPAD_DOWN);
if(left) {
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_LEFT);
}if(right) {
Gamepad.dPad1(GAMEPAD_DPAD_DOWN_RIGHT);
}
}else if(up) {
Gamepad.dPad1(GAMEPAD_DPAD_UP);
if(left) {
Gamepad.dPad1(GAMEPAD_DPAD_UP_LEFT);
}if(right) {
Gamepad.dPad1(GAMEPAD_DPAD_UP_RIGHT);
}
}else if(left) {
Gamepad.dPad1(GAMEPAD_DPAD_LEFT);
}else if(right) {
Gamepad.dPad1(GAMEPAD_DPAD_RIGHT);
}
for(int i = 4; i <16; i++)
{
if(!digitalRead(i)) {
Gamepad.press(i);
}else {
Gamepad.release(i);
}
}
Gamepad.write();
int sensorValue = analogRead(A0); // read the input on analog pin 0:
//Serial.println(sensorValue); // print out the value you read
float voltage = sensorValue * (4.88 / 1023.00);
//Serial.println(voltage);
if(Serial.available())
{
i=Serial.read();
}
if(i=='1')
{
Serial.println(sensorValue);
}
i='0';
if (voltage > 4.5)
{
digitalWrite(16, HIGH);
}
else
{
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(ledPin, ledState);
}
}
delay(10);
}
- Wailer
- Posts: 119
- Joined: Mon Jan 15, 2018 3:45 pm
- Location: Tiel, The Netherlands
- Has thanked: 30 times
- Been thanked: 38 times
Re: OSD Battery Monitoring for Helder's AIO Boards
It seems you're missing a library, namely this one "vHID-Project.h"
You can get it here http://downloads.arduino.cc/libraries/g ... -2.4.4.zip
You can get it here http://downloads.arduino.cc/libraries/g ... -2.4.4.zip
Re: OSD Battery Monitoring for Helder's AIO Boards
Where can I get Helder’s board? I am planning on using a tinkerboy right now.
Check out my bluetooth speaker in an altoids tin! https://sudomod.com/forum/viewtopic.php?t=7274
-
- Posts: 14
- Joined: Fri May 11, 2018 12:49 am
- Location: Rome, Italy
- Has thanked: 2 times
Re: OSD Battery Monitoring for Helder's AIO Boards
I implemented the library and some moreWailer wrote: ↑Sun May 13, 2018 4:22 pmIt seems you're missing a library, namely this one "vHID-Project.h"
You can get it here http://downloads.arduino.cc/libraries/g ... -2.4.4.zip
now this is the error, it is so long that it wiont fit in the message, here are the first few lines
tomorrow i will reinstall arduino and teensydoino and redo everithing from the beginning,
would it be possible to add instead a ads1015 module and work only on the raspy side using mintymonitor? i know it is integrated in the teensy but at this point would save me the headache..
Code: Select all
Arduino:1.8.5 (Windows 10), TD: 1.41, Scheda:"Teensy 2.0, Keyboard + Mouse + Joystick, 16 MHz, US English"
In file included from C:\Users\marley\Documents\Arduino\libraries\HID-Project\src/SingleReport/USBAPI.h:33:0,
from C:\Users\marley\Documents\Arduino\libraries\HID-Project\src/SingleReport/PluggableUSB.h:23,
from C:\Users\marley\Documents\Arduino\libraries\HID-Project\src/SingleReport/SingleAbsoluteMouse.h:28,
from C:\Users\marley\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:39,
from C:\Users\marley\Desktop\sketch_may13a\sketch_may14a\sketch_may14a.ino:1:
- Wailer
- Posts: 119
- Joined: Mon Jan 15, 2018 3:45 pm
- Location: Tiel, The Netherlands
- Has thanked: 30 times
- Been thanked: 38 times
Re: OSD Battery Monitoring for Helder's AIO Boards
I can understand your headache... Arduino software can do that sometimes...
The errors it throws can be very cryptic...
The first error line (look for the line number) is mostly the line where the trouble starts, everything that follows is (most of the time) irrelevant (one ; forgotten can cause a sh*tload of following errors
).
You are using ide 1.8.5. so that's ok.
Al boards with atmega 32u4/90usb should be supported so the teensy can't be the problem, that is if you are using the 2.0 (or the ++ version).
Do you have the right board selected? You can only upload this sketch to supported boards (the software checks this an gives you a error if not).
The ads1015 is a solution (also for your headache), check the forums on how to use this.
Like i said, i used a Leonardo compatible board i have never worked with a teensy.
Maybe there are other forum members who can shed some light on this?
The errors it throws can be very cryptic...
The first error line (look for the line number) is mostly the line where the trouble starts, everything that follows is (most of the time) irrelevant (one ; forgotten can cause a sh*tload of following errors

You are using ide 1.8.5. so that's ok.
Al boards with atmega 32u4/90usb should be supported so the teensy can't be the problem, that is if you are using the 2.0 (or the ++ version).
Do you have the right board selected? You can only upload this sketch to supported boards (the software checks this an gives you a error if not).
The ads1015 is a solution (also for your headache), check the forums on how to use this.
Like i said, i used a Leonardo compatible board i have never worked with a teensy.
Maybe there are other forum members who can shed some light on this?
-
- Posts: 14
- Joined: Fri May 11, 2018 12:49 am
- Location: Rome, Italy
- Has thanked: 2 times
Re: OSD Battery Monitoring for Helder's AIO Boards
Hi,
Yes the board is compatible.. a was able to upload the sketch done by wermy.. this one doesn want to compile.. i will try again tonight by doing a full reinstall of the programs on my pc and report back.. thanks alot for your support and, most of all, patience..
Yes the board is compatible.. a was able to upload the sketch done by wermy.. this one doesn want to compile.. i will try again tonight by doing a full reinstall of the programs on my pc and report back.. thanks alot for your support and, most of all, patience..
- Wailer
- Posts: 119
- Joined: Mon Jan 15, 2018 3:45 pm
- Location: Tiel, The Netherlands
- Has thanked: 30 times
- Been thanked: 38 times
Re: OSD Battery Monitoring for Helder's AIO Boards
I loaded the sketch and selected the teensy as board, and yup, errors galore
. (same code leo as board=no problem
).
It seems to program the teensy with this sketch you need a lot more libraries...
So i guess it's not in your software (saves you a reinstall).
There should be a lot more forum members using a teensy as a battery monitor...
Come on guys...
Btw where did you find Wermy's sketch?


It seems to program the teensy with this sketch you need a lot more libraries...
So i guess it's not in your software (saves you a reinstall).
There should be a lot more forum members using a teensy as a battery monitor...
Come on guys...
Btw where did you find Wermy's sketch?
-
- Posts: 14
- Joined: Fri May 11, 2018 12:49 am
- Location: Rome, Italy
- Has thanked: 2 times
Re: OSD Battery Monitoring for Helder's AIO Boards
This is the link http://sudomod.com/wp-content/uploads/2 ... y_Zero.zip i found it on his gbz guide.. it handles key presses only..
Yesterday i loded all the libraries missing but than i started getting the 10miles long error i told you about...
Yesterday i loded all the libraries missing but than i started getting the 10miles long error i told you about...
Who is online
Users browsing this forum: No registered users and 1 guest