Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team
megahz wrote:@Claus:
you could cut a few of the heatsink parts, i did that with a D510MO Mainboard too, so it fits into a 1HE 19" Case.
Doesn't get much warmer........
spiny wrote:....- you could trim the fins that are in the way, and probably not see any impact with temps.
spiny wrote:For backup, you could put a small fan in there as well, to blow air over the heatsink.
Code: Select all
#include <Arduino.h>
#include <EEPROM.h>
#define ST_KB_RESET 9 // Reset pulse for the ST keyboard on this pin.
//#undef ST_KB_RESET // Uncomment if you're using a Mega/TT keyboard.
#define CAPSLOCK_LED 10
#define PCMODE_LED_FREQ 1000
HardwareSerial ST_kbd = HardwareSerial();
// EEPROM structure
#define get_KBMODE (EEPROM.read(0) ? MODE_PC:MODE_ST)
#define save_KBMODE(mode) EEPROM.write(0, mode)
float volt = 55;
int taste = 0;
int makro_key = 0;
void setup(void)
{
ST_kbd.begin(7812);
#ifdef CAPSLOCK_LED
pinMode(CAPSLOCK_LED, OUTPUT);
digitalWrite(CAPSLOCK_LED, HIGH);
#endif
pinMode(11, OUTPUT); // Onboard LED
digitalWrite(11, HIGH);
// --------------------------------------------------
// RGB-LED für Batteriespannung
// --------------------------------------------------
pinMode(6, OUTPUT); // gem.Anode RGB LED
digitalWrite(6, HIGH);
pinMode(5, OUTPUT); // Blau der RGB LED
digitalWrite(5, HIGH);
pinMode(4, OUTPUT); // Grün der RGB LED
digitalWrite(4, HIGH);
pinMode(3, OUTPUT); // Rot der RGB LED
digitalWrite(3, HIGH);
// Check if a ST keyboard is attached.
reset_st_keyboard();
delay(100);
// Num Lock on
Keyboard.set_key1(KEY_NUM_LOCK);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
// Init USB joystick
joystick_init();
}
void loop(void)
{
if (ST_kbd.available() > 0)
{
process_st_key(ST_kbd.read());
}
// Blinkenlicht
#ifdef CAPSLOCK_LED
blink_leds();
#endif
volt = map(analogRead(0), 0, 838, 0, 1630); // Batteriespannung über 1:3 Teiler 33K/99K
volt = volt / 100;
taste = analogRead(1); // analog Werte der Tasten mit 5x 4K7 Widerständen
if (taste > 900)
{
makro_key = 0; // 0
}
if (taste < 490)
{
makro_key = 0; // 0
}
if (taste < 520 & taste > 500)
{
makro_key = 4; // 0
Keyboard.print("Batteriespannung ist ");
delay (250);
Keyboard.print(volt);
delay (250);
Keyboard.println(" Volt");
delay (500);
}
if (taste < 690 & taste > 670)
{
makro_key = 3; // 0
}
if (taste < 770 & taste > 750)
{
makro_key = 2; // 0
Keyboard.println("user");
delay (250);
Keyboard.println("password");
delay (500);
}
if (taste < 850 & taste > 800)
{
makro_key = 1; // 0
Keyboard.println("Da Privatverkauf, keine Garantie oder Rücknahme!");
delay (250);
Keyboard.println("Viel Spass beim bieten!");
delay (500);
}
// ------------------------------------------------------------
// Batterie Anzeige
// ------------------------------------------------------------
if (volt > 13.80 & volt < 15.00)
{
digitalWrite (5, HIGH);
digitalWrite (4, HIGH);
digitalWrite (3, LOW);
}
if (volt > 13.30 & volt < 13.80)
{
digitalWrite (5, HIGH);
digitalWrite (4, LOW);
digitalWrite (3, LOW);
}
if (volt > 11.90 & volt < 13.30)
{
digitalWrite (5, HIGH);
digitalWrite (4, LOW);
digitalWrite (3, HIGH);
}
if (volt > 10.90 & volt < 11.90)
{
digitalWrite (5, LOW);
digitalWrite (4, LOW);
digitalWrite (3, HIGH);
}
if (volt > 10.60 & volt < 10.90)
{
digitalWrite (5, LOW);
digitalWrite (4, HIGH);
digitalWrite (3, HIGH);
}
if (volt < 10.60)
{
digitalWrite (5, LOW);
digitalWrite (4, HIGH);
digitalWrite (3, HIGH);
delay(250);
digitalWrite (5, HIGH);
delay(250);
digitalWrite (5, LOW);
}
}
vfrvulcan wrote:Flashing the slow or fast blink hex files (blink_fast_Teensy2pp.hex located elsewhere in this thread)
vfrvulcan wrote:I've had another play with this tonight and figured I'd try it on a USB 2 port instead of USB 3 (testing on PC before going to the Pi).
It seems that it works fine for half a dozen or so characters then decides that it's going to throw in random characters on a keypress, sometimes two. A lot of the time it will throw in what seems to be F1 as Internet Exploder gets launched and goes to a Windows 10 help page, other times it brings up the search box in Notepad (which is where I'm trying it) or a dialog box with string not found.
After this I have to disconnect the Teensy for a while and plug it back in. I get the same results plugging back into USB 3 so it's not a USB2/3 issue
Any way to check if I have a good Teensy? A bit stumped at mo.
As before, any help appreciated!
roninfourseven wrote:I am also sorry to pull up this post after such a while, but I am in the same boat as VFRVulcan. I also have a Teensy 2.0++, and am wired identically.
Something is clearly working, as if I type as soon as I plug in the keyboard, I can type actual words, but within 30 seconds it all goes awry and I just get random characters coming through.
I have tried both the Tennsy 2.0 and Teensy 2.0++ firmware from this thread and the result is much the same, with immediate use showing the correct characters, and 30 seconds later, garbage.
I am more than willing to do any testing to get this to work.
I can confirm that the test programs for the Teensy work fine, and as it was brand new I am willing to believe that is is fine.
roninfourseven wrote:So, I thought it worthwhile trying to swap the ground pin as you suggested, as its a quick and easy thing to do, and the damn thing is working. In fact I've just typed this whole
And that is as far as I got before it went wonky again. I will rewire as per your pic above and will let you know what happens.
Users browsing this forum: No registered users and 4 guests