Subscribe via RSS
8Jan/190

B&O BeoVision MX 7000 Homebrew Remote

After picking this TV up off the footpath, I found it to be a little tedious without a remote. A quick google saw that it needs a specific B&O remote and not just any universal contraption. From here, I managed to use my PC's serial port and WinLIRC to control the TV, albeit rudimentally. The MSX, whilst over SCART, wasn't displaying a proper picture, so I knew I needed a proper remote to flick through the settings quickly.

Arduino as a remote translator

I found a neat little Arduino Remote at Jaycar and decided on the spot that I'd use an Arduino to translate its buttons to those of the TV. This would require an IR Receiver and an IR Transmitter. I know the B&O tranmission needs to be fast, but the receiver can be anything off-the-shelf as long as it works with this remote below!

DSC06318

Thanks to Sparkfun's great IR tutorial, the build of the actual circuit was very simple. Two modules and a resistor! Make sure you point them in different directions so as to prevent one remote from interfering with the other.

DSC06336

Ken Shirrif's IRRemote Library is the only code library needed to get up and running. I then started searching for help on timings... It turns out that someone else has already requested this functionality but there's no confirmed results. Fortunately, there's a few good hints towards the bottom regarding transmission signal timing. Supposedly the library can be tuned to just output the data at the right frequency... so... let's try! We do get another hint here about setting the right timing, but with a warning that the timing might not be 100%. It seems that the unit can deal with a 10khz difference.

Anyway... I was going to go long-winded with a simple chunk of code to just send a power-on, then a chunk to receive the data from the cheap remote, then a bridge to bring it all together... but instead, here's the answer.

#include <IRremote.h>

#define TV_ON 0
#define DVD_ON 1
#define TV_SAT_DVD_GO 2
#define ARROW_UP 3
#define ARROW_DOWN 4
#define ARROW_LEFT 5
#define ARROW_RIGHT 6
#define TV_MENU 7
#define VOL_UP 8
#define VOL_DOWN 9
#define KEY_ZERO 10
#define KEY_ONE 11
#define TAPE_ON 12
#define ALL_OFF 13
#define CHAN_DOWN 14
#define SAT_ON 15
#define V_AUX 16

//now for the button data, each is 2 bytes, but only the second is used, 
//to use the indexes above to store the second bytes in a 8-bit padded array.

unsigned int button_bytes[] = {
  200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, //TV_ON
  200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, //DVD_ON
  200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, //TV_SAT_DVD_GO
  200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, //ARROW_UP
  200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, //ARROW_DOWN
  200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, //ARROW_LEFT
  200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 6250, //ARROW_RIGHT
  200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, //TV_MENU
  200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, //VOL_UP
  200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 6250, //VOL_DOWN
  200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, //KEY_ZERO
  200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, //KEY_ONE
  200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, //TAPE_ON
  200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, //ALL_OFF
  200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, //CHAN_DOWN
  200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, //SAT_ON
  200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, //V_AUX
};

//the following list are the full button suite... I need to update and repair this code... the first 8 bits don't always match above!
unsigned int beo4_tv_left[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_tv_right[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_up[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_tv_down[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_green[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 2800, 200, 9375, 200, 12500, 200};
unsigned int beo4_tv_yellow[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_red[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_tv_blue[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_exit[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_menu[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_stop[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_tv_0[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_1[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_tv_2[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_tv_3[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_4[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_5[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};
unsigned int beo4_tv_6[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_tv_7[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_8[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_tv_9[] = 				{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};

unsigned int beo4_video_vol_up[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_video_vol_down[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_video_record[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};

unsigned int beo4_tv_on[] = 		 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_dvd_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_sat_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_cd_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_text_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_atape_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_radio_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_vtape_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 2800, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};

unsigned int beo4_audio_poweroff[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_video_poweroff[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_all_power_off[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};

unsigned int beo4_tv_sat_dvd_go[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200, 

unsigned int beo4_vtape_left[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_vtape_right[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 2800, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_up[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_vtape_down[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_green[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 2800, 200, 9375, 200, 12500, 200};
unsigned int beo4_vtape_yellow[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_red[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_vtape_blue[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_exit[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 2800, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6200, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_menu[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_stop[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 2800, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 2800, 200, 12500, 200};
unsigned int beo4_vtape_0[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_1[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 2800, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_vtape_2[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 2800, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_vtape_3[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_4[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 2800, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_5[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 2800, 200, 9375, 200, 12500, 200};
unsigned int beo4_vtape_6[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_vtape_7[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_8[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_vtape_9[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};

unsigned int beo4_light_on[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_left[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_light_right[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_up[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_light_down[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_green[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};
unsigned int beo4_light_yellow[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_red[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_light_blue[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_menu[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_stop[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_light_0[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_1[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_light_2[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_light_3[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6350, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_4[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_5[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};
unsigned int beo4_light_6[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_light_7[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_8[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_light_9[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};

unsigned int beo4_audio_left[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_audio_right[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_up[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_audio_down[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_green[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};
unsigned int beo4_audio_yellow[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_red[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_audio_blue[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_menu[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_stop[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_audio_record[] =		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_0[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_1[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_audio_2[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 12500, 200};
unsigned int beo4_audio_3[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_4[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_5[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 12500, 200};
unsigned int beo4_audio_6[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 3125, 200, 12500, 200};
unsigned int beo4_audio_7[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_8[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_9[] = 			{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 9375, 200, 12500, 200};
unsigned int beo4_audio_exit[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_vol_up[] = 		{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 12500, 200};
unsigned int beo4_audio_vol_down[] = 	{200, 3125, 200, 3125, 200, 15625, 200, 3125, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 9375, 200, 3125, 200, 9375, 200, 6250, 200, 3125, 200, 6250, 200, 9375, 200, 3125, 200, 6250, 200, 12500, 200};

int RECV_PIN = 9;
int khz = 455; 
IRrecv irrecv(RECV_PIN);
decode_results results;
IRsend irsend;

unsigned int irHeader[] = {
  200, 3125, 200, 3125, 200, 15625, 200, 3125, //4 start bits
  200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250, 200, 6250 // 8 0 data bits
};
unsigned int irFooter[] = {200, 12500, 250};

void setup()
{  
  Serial.begin(9600);
  Serial.print("Enabling IRin...");
  irrecv.enableIRIn();
  Serial.println("Done");
}

void sendCommand(int cmd)
{
  irsend.sendRaw(irHeader, sizeof(irHeader) / sizeof(irHeader[0]), khz);
  irsend.sendRaw(button_bytes + (cmd * 16), 16, khz);
  irsend.sendRaw(irFooter, sizeof(irFooter) / sizeof(irFooter[0]), khz);
}

int z = 0;
unsigned long lastCode = 0;
void loop() {
  if (irrecv.decode(&results)) {
    switch(results.value) {
      case 0x00FFA25D: // CH-
      case 0xE318261B: 
        sendCommand(DVD_ON);
        break;
        
      case 0x00FF629D: // CH
      case 0x00511DBB: 
        sendCommand(TV_ON);
        break;

      case 0x00FFE21D: // CH+
      case 0xEE886D7F: 
        sendCommand(V_AUX);
        break;

      case 0x00FF22DD: // |<<
      case 0x52A3D41F: 
        sendCommand(ALL_OFF);
        break;
        
      case 0xD7E84B1B: // >>|
      case 0x00FF02FD: 
        sendCommand(SAT_ON);
        break;
        
      case 0x20FE4DBB: // >||
      case 0x00FFC23D:
        sendCommand(TAPE_ON);
        break;

      case 0x00FFE01F: // VOL-
      case 0xF076C13B: 
        sendCommand(VOL_DOWN);
        break;
        
      case 0x00FFA857: // VOL+
      case 0xA3C8EDDB: 
        sendCommand(VOL_UP);
        break;
        
      case 0x00FF906F: // EQ
      case 0xE5CFBD7F:
        sendCommand(TV_MENU);
        break;

      case 0x00FF6897: // 0
      case 0xC101E57B:
        sendCommand(KEY_ZERO);
        break;
        
      case 0x00FF9867: // 100+
      case 0x97483BFB:
        sendCommand(KEY_ONE);
        break;
        
      case 0x00FFB04F: // 200+
      case 0xF0C41643: 
        break;

      case 0x00FF30CF: // 1
      case 0x9716BE3F:
        break;
        
      case 0x00FF18E7: // 2
      case 0x3D9AE3F7:
        sendCommand(ARROW_UP);
        break;
        
      case 0x00FF7A85: // 3
      case 0x6182021B: 
        break;
      
      case 0x00FF10EF: // 4
      case 0x8C22657B:
        sendCommand(ARROW_LEFT);
        break;
        
      case 0x00FF38C7: // 5
      case 0x488F3CBB:
        sendCommand(TV_SAT_DVD_GO);
        break;
        
      case 0x00FF5AA5: // 6
      case 0x449E79F:
        sendCommand(ARROW_RIGHT);
        break;
      
      case 0x00FF42BD: // 7
      case 0x32C6FDF7: 
        break;
        
      case 0x00FF4AB5: // 8
      case 0x1BC0157B:
        sendCommand(ARROW_DOWN);
        break;
        
      case 0x00FF52AD: // 9
      case 0x3EC3FC1B: 
        break;

      case 0xffffffff:
        //this means we've had a repeat... use the last code and allow volume up/down
        if (lastCode == 0x00FFE01F || lastCode == 0xF076C13B) sendCommand(VOL_DOWN);
        if (lastCode == 0x00FFA857 || lastCode == 0xA3C8EDDB) sendCommand(VOL_UP);
        break;
      
      default:
        if (results.value > 0xF0FFFF and results.value <= 0xffffffff)
          Serial.println(results.value, HEX);
        break;
    }
    //don't enter on 0xffffffff here, otherwise we'll whack our repeat!
    if (results.value > 0xF0FFFF and results.value < 0xffffffff) {
      lastCode = results.value;
    }
    //restart the receiving after sending!
    irrecv.enableIRIn();
    irrecv.resume();
  }
  delay(100);
}

DSC06317

You'll note that I have a V.Aux button configured up there. Turns out that I couldn't set both SCART plugs to DVD and cycle through... one would default to V.AUX automatically when trying to set the first to DVD. I therefore had to be able to press the button. The base configuration didn't have this coded! Ah! Found the button here. I have a suspicion there's a host of other buttons to map... Maybe I should go and buy a remote.

Meanwhile, turns out that this thread is the source of the correct configuration. Doesn't seem to have all the buttons though!

DSC06324 DSC06321 DSC06325

With all this done, attempting to get to the service menu with MENU,1,1,GO doesn't work. I do get the software version with MENU,0,0,GO... So I may be locked out. Regardless... I wasn't able to fix the issue I actually wanted to: the MSX still hates RGB. Loves Composite though!

Filed under: Retro No Comments
8Jan/190

B&O BeoVision MX 7000 TV

So this is nothing short of weird... After having to walk half-way across Melbourne to get home (thanks to the train lines being shut for upgrades), I find this unit sitting out the front of my apartment building. The weird part is this: I swear this is the exact same TV I saw in a 'vintage shop' in Geelong around a year ago. Geelong is a long way away... and for this ridiculously heavy unit to appear in front of my apartment... in dirty-but-OK condition, is totally surprising.

DSC06312

DSC06315 DSC06314 DSC06316

Of course, this is Melbourne and just maybe there's a lot of rich people with expensive+vintage TV sets just sitting around...

Does it work?

I threw caution to the wind and found a protected power board to plug it in to. A quick visual inspection before hitting the switch and click... we have a red stand-by light! A quick search of the front panel found a power button bottom-right and, tapping this, the unit came to life!

No remote control

Not a deal-breaker... or so I first thought. Turns out B&O decided to use a non-standard IR frequency and standard universal remotes just won't work. LIRC was fun back in the day, so I installed WinLIRC and tried to load up the easy-to-find Beo4 Configuration. Before even trying to hack together a transmitter, I was hit with errors trying to load the configuration.

winlirc-1 winlirc-2 winlirc-3

Not very helpful at all! I hacked around with configuration file and found that it didn't seem to like the area between the raw_codes begin and end. Darn... maybe it's an archaic Windows version... so I installed Mint on the old Intellistation Z and tried again...

After booting into Linux Mint, I installed lirc with sudo apt install lirc. No issues here, so I downloaded and copied the Beo4 configuration to /etc/lirc/lircd.conf. A quick sudo service lirc restart and syslog tells me:

steven@intelli ~/Downloads $ sudo cp Beo4 /etc/lirc/lircd.conf
steven@intelli ~/Downloads $ sudo service lirc restart
steven@intelli ~/Downloads $ tail /var/log/syslog 
Jan  7 19:11:47 intelli lirc[3220]:  * Loading LIRC modules
Jan  7 19:11:47 intelli lirc[3220]:    ...done.
Jan  7 19:11:47 intelli lirc[3220]:  * Starting remote control daemon(s) :
Jan  7 19:11:47 intelli lircd-0.9.0[3230]: error in configfile line 45:
Jan  7 19:11:47 intelli lircd-0.9.0[3230]: "KEY_0": must be a valid (unsigned int) number
Jan  7 19:11:47 intelli lirc[3220]:    ...done.
Jan  7 19:11:47 intelli lircd-0.9.0[3230]: reading of file '/etc/lirc/lircd.conf' failed
Jan  7 19:11:47 intelli lircd-0.9.0[3230]: reading of config file failed
Jan  7 19:11:47 intelli lircd-0.9.0[3231]: lircd(dsp) ready, using /run/lirc/lircd
Jan  7 19:11:47 intelli systemd[1]: Started LSB: Starts LIRC daemon..

Oh! Right! Here's the actual error! WinLIRC just 'failed', whereas I get proper verbose logging in Linux. Turns out the configuration file is just no good. I ended up browsing back to the lirc page, in a vain attempt to find a forum or mailing list to whinge to... but then... I found the real remote repo! Scrolling down... lo'n'behold is the Beo4 LIRC Configuration File with happy 'compatible' ticks. Opening it, I can see it's a completely different file!

steven@intelli ~/Downloads $ sudo cp Beo4.lircd.conf /etc/lirc/lircd.conf
steven@intelli ~/Downloads $ sudo service lirc restart
steven@intelli ~/Downloads $ tail /var/log/syslog 
Jan  7 19:13:39 intelli lircd-0.9.0[3231]: caught signal
Jan  7 19:13:39 intelli lirc[3467]:    ...done.
Jan  7 19:13:39 intelli systemd[1]: Stopped LSB: Starts LIRC daemon..
Jan  7 19:13:39 intelli systemd[1]: Starting LSB: Starts LIRC daemon....
Jan  7 19:13:39 intelli lirc[3478]:  * Loading LIRC modules
Jan  7 19:13:39 intelli lirc[3478]:    ...done.
Jan  7 19:13:39 intelli lirc[3478]:  * Starting remote control daemon(s) :
Jan  7 19:13:39 intelli lirc[3478]:    ...done.
Jan  7 19:13:39 intelli lircd-0.9.0[3489]: lircd(dsp) ready, using /run/lirc/lircd
Jan  7 19:13:39 intelli systemd[1]: Started LSB: Starts LIRC daemon..

Ok, neat... we loaded! What can we send?

steven@intelli ~/Downloads $ irsend list "Bang&Olufsen_Beo4" ""
irsend: 0000000000000001 beo4-tv-on
irsend: 0000000000000002 beo4-video-poweroff
irsend: 0000000000000003 beo4-tv-left
irsend: 0000000000000004 beo4-tv-right
irsend: 0000000000000005 beo4-tv-up
irsend: 0000000000000006 beo4-tv-down
irsend: 0000000000000007 beo4-tv-green
irsend: 0000000000000008 beo4-tv-yellow
irsend: 0000000000000009 beo4-tv-red
irsend: 000000000000000a beo4-tv-blue
irsend: 000000000000000b beo4-tv-exit
irsend: 000000000000000c beo4-tv-menu 
....

And that's as far as I got on Linux... For the life of me it wasn't worth the effort trying to work out how to use /dev/ttyS0. It seems that the kernel hogs it and you have to setserial and stuff... so I just re-booted back into windows... on a machine closer to the TV...

winlirc-4

Just because Windows is easier and I'm lazy, I plugged the file into WinLIRC... It worked! We're set... time for some actual hardware to get the IR transmitting.

Transmitting signals...

I found some IR sensors that I had lying around... they're TCRT5000s and I only need the transmitting half. That's the half with the bevelled side (when you're looking at it) and the anode is up top. A 220ohm resistor was tied in-line to prevent excess serial current draw.

DSC06282

The contraption was pointed at the TV, but no amount of clicking would work to turn the TV on. I was about to give up, but decided that the transmit power could be an issue and held the IR LED 5cm from the receiver. Presto! Power-On worked!

DSC06284

I plugged the MSX into the SCART plug and got the following... more research to be done! I also need a better mechanism for pressing remote buttons if I'm going to go through the menu and adjust settings.

What about Arduino?

Having a whole computer to control a TV isn't optimal... so...Arduino time! Well.. it will be in the future... after I read this, this, this, this and this. The goal will be to build a controller with enough buttons to re-configure the input... hopefully... to get the MSX to display!

UPDATE: Arduino Remote works like a charm!

Sony Playstation

I suddenly realised that I actually did have a device to plug into this monstrosity. The original Sony Playstation gathering dust under my coffee table has Composite out! Of course, the TV does not have Composite in... so I had to improvise with a Composite-to-SCART adapter.

DSC06308 DSC06296 DSC06302

DSC06304

Yey! Abe's Odyssey!

Filed under: Retro No Comments
14Dec/180

Sony HITBIT HB-F1XD Floppy Drive

Hello again Mr HIT BIT. I bought this unit a while back and never got around to testing the floppy drive...

DSC05537

As you can see from the image below, there was a sticker attached that said the Floppy drive was problematic. (フロッピーディスクは動作しません)

DSC09339

This didn't worry me too much, as I intended to use the cartridge slot more than the floppy drive. Regardless, I wanted to eventually test it out. I actually even bought a random second-hand disk from a second-hand shop in Japan whilst purchasing the main unit.

DSC05555

Based on the sticker... the first goal was to inspect the drive!

Pulling the unit apart

In full Sony-style, there's 6 screws (with arrows pointing to them!) on the underneath of the unit that need to be undone. Once they're out, flip the unit back on its base and remove the cover left-to-right. The floppy disk eject button is seated through a hole in the top half of the case, so be careful when removing!

DSC05540

Once off, there's a shield on top of the floppy drive to remove. This has one screw top-right. Undo the screw and then use a flat-head screwdriver to prize off the clips along the back of the floppy drive. After this, there are then three screws that hold down the bracket that the drive is attached to. With these out, you can then perform a back-flip with the drive and expose the wiring. It turns out it's a 34-pin data cable and standard floppy drive power cable!? But with only the 5v wiring.

DSC05541 DSC05543 DSC05545

The drive itself

Things got interesting from here... after removing the top case (more clips, use a flat-head screwdriver), I noticed that there didn't seem to be a drive-belt at all. All articles online indicated that these drives had belts and are known to perish over time. I started pulling the drive apart further and found out that Sony actually chose to split the drive motor across the base PCB!? Talk about a nice way to save space... and not have to need a belt!

DSC05547 DSC05548 DSC05551

DSC05553

Talk about mesmerising... those copper coils are beautiful! But dang... I'd gone and bought a belt and everything... if this still isn't working, as per the sticker, then I'm really in trouble!

Testing the drive

I put it as-back-together-as-needed to test the drive and turned it all on. I put the disk in, but all was very quiet. My MegaFlashROM loaded into Nextor and I hit the number '2' key to switch to the second drive.

DSC05557

What? It works? MENU.BAS sounds like a good place to start...

DSC05562

Ok, here we go... is this a demo disk? "Tanaka Yatsuu Shin"? I'll need a bit of help translating this... regardless, "CG" sounds like fun!

DSC05564

4 Images? Here they are in order...

DSC05567 DSC05571 DSC05572

DSC05565

I had it all working nicely, but the machine was half apart... so I screwed it all back together.

Floppy Drive Issues

Once back together, the drive refused to read. Taking it apart bit-by-bit, it started reading again once the drive shell was off... but this wasn't reliable either...

DSC05585

Gosh-darn... it's time to dig further into this drive... It seems I can wire in a PC drive.. but first I'll open the whole unit up again and give it a proper clean. It felt like it was having issues understanding that the disk was in the drive... I'll start there and determine what sensors are used and if they're functioning correctly... but that's all in the new year!

Filed under: Retro No Comments
11Dec/180

Digital 54-22703-01 Motherboard – L2 Cache

After making this motherboard fit into the IBM PS55/z, I realised I hadn't decked it out fully. I'd mentioned cache in the first post, and finally got around to ordering some. The goal was to speed up the poor old 486 as it wasn't running as fast as I would've expected it to. Of course, this was also all very subjected as it'd be pretty impossible to actually remember how fast my first PC actually ran!

Usually, parts like this can be pilfered from other items laying on the shelves in my apartment, but this motherboard needed specific 'TAG' RAM, as well as the standard 32KBx8 static RAM chips. I had to go hunting...

Required components

Back to Pafe 45 of the User Manual for this motherboard and we find that we need eight 32 KB x 8 cache SRAM chips and three 16 KB x 4 cache tag SRAM chips to max it out. Straight to eBay and I found a seller in Israel with the correct parts. I incorrectly ordered two sets of TAG RAM chips and only half the required static RAM chips... whoops... fortunately I could pilfer those off another board!

DSC05502

The TAG RAM chips are labelled MCM6290BP25 RIQAB9131.

DSC05511

As per usual... always be careful when inserting ICs. Make sure their legs are aligned with the sockets and don't press until it's safe... otherwise this happens!

DSC05516

DSC05517

With everything in, we just need to adjust the jumpers...

DSC05522

Set all four jumpers (J3,J4,J6,J7) to 2-3... and then boot!

DSC05526

Yosh!

Test Software

Go here and download anything that starts with Cache. I then tested them all out...

DSC05527 DSC05528 DSC05531

They all showed that any data size under 256kb proved quick response times. The rest started spiking as more operations were required. The CCT386 application had awesome graphs.

DSC05536

Now to work out if the games actually operate faster...

Filed under: Retro No Comments
4Dec/180

Microchannel Sounds Cards (aka Hen’s Teeth)

I was interested in these when the IBM PS/55z was on its way as I wanted to deck the machine out with sound. Turns out that MCA is a rare breed and actually-interesting cards are impossible to come by.

Imagine my surprise when I saw an MCA ChipChat Sound Card (with wavetable addon!) appear on eBay. It started at AUD$50 and I was interested... just because it had to be an investment to sell later?

Here's the description...

This a ChipChat Sound-32 Card for a IBM PS/2 Microchannel computer.
It comes with original box and contents. Including reference disk and driver disk.
Drivers are for DOS, Win (3.1, 95, NT), OS/2 (2.x, Warp)

And a few pictures:

s-l1600

s-l1600 (1) s-l1600 (3) s-l1600 (2)

So yeah, nothing special... not even a mention if it works? Anyway... the 7 days were nearly over and it had gotten up to AUD$141. I was a little disjointed, but yeah... it's a relic! I mean, it's beautiful.. but... I wasn't expecting the outcome:

wtf

I'm very happy that someone, who I hope REALLY REALLY wanted it, got a very nice piece of computing history!

Filed under: Retro No Comments
3Dec/180

Testing EGA/CGA Cards

I'd picked these up a while back but never thought I'd get to test them. I don't have any monitors that support the old standard and haven't actually seen any available on eBay for a long time. I was quite surprised when I realised that the GBS-8200 that I picked up for my MSX would work to convert the frequencies! I'd only ever expected to use it for the MSX RGB signal.

V7 VEGA 8-BIT VGA

This card (thanks, stason.org!) has the ability to output both EGA/CGA and VGA! It's 8-Bit ISA and it a little worse-for-wear...

DSC05463

DSC05464 DSC05467 DSC05469

DSC05471 DSC05473 DSC05478

This seems to be quite an advanced card of its era. Happily outputting to the monitor you happen to have and allowing for future upgrades! It also even seems to have the VGA auxiliary header?

VIDEO SEVEN V7 VEGA EGA

This card (thanks again to stason.org!) is a little older. It has a header for a light-pen and suppsoedly two composite video inputs!?

DSC05434

DSC05439 DSC05445 DSC05450

GBS-8200

I had purchased the bare-bones board and never tried it. Thanks to my new desktop power supply, getting it going was really very easy. The board comes with a standard DC jack, but also a pin header for the input voltage. Instead of using a crappy wall-wart, I instead powered it on the supply, having the additional benefit of knowing the current requirement!

DSC05480

DSC05483 DSC05484 DSC05486

Ian Stedman thoroughly reviewed this board. His outcome was that there were a few issues, but a strong power supply is not needed. It turns out that my testing below shows that it hardly needs 5v at 400mA!

You can see where I've soldered on to for the EGA/CGA input. It's the bottom-right 5-pin header and I couldn't find an acceptable plug. In the end, a quick bit of tinning worked. There's 4 wires: R,G,B, Sync and Ground. The EGA Pinout on Wikipedia (CGA is nearly identical) shows that there are two sync lines, but we only have one on the GBS-8200! As mentioned above, we'll use the bottom-left connector on the board.

Combining HSync and VSync

We'll need to combine the Horizontal and Vertical Sync outputs from the EGA signal as the GBS-8200 requires a single Composite Sync signal. To do this, we can use an XOR or OR gate. Ian is our saviour once again and has provided a circuit to combine the signals.

Build the circuit as he's described. I actually found that either XOR or OR worked fine with the GBS-8200!

DSC05452

DSC05455 DSC05457 DSC05459

I probably should've tested some games...

Hercules?

No such love. Same connector, but a very different video signal. Turns out it's actually a digital TTL signal that this unit cannot process. If you really want yo convert it then you'll need to buy a GBS8219.

DSC05489

DSC05490 DSC05491 DSC05493

Is that a printer port? Space saving tech! I don't have any plans to pay for a Hercules monitor or an 8219, so this is going straight on eBay.

Filed under: Retro No Comments
15Nov/180

DOS USB CD Drives? Of course!

After mucking around trying for a while trying to get the new Compaq motherboard into the old IBM PS55/Z, I realised I'd wasted a lot of time playing with SCSI cards. This motherboard has a USB port! Can I use an external USB CD drive in DOS? It turns out the answer is yes!

Download USBASPI.SYS from here and then a USBCD.SYS (choose your brand) from here. I fluked it and tried the first USBCD1.SYS driver which worked perfectly! Firstly, copy the files to your HDD (I always put them in C:\DOS\), and then edit CONFIG.SYS:

DEVICE=C:\DOS\USBASPI.SYS
DEVICE=C:\DOS\USBCD.SYS /D:MSCD001

And don't forget AUTOEXEC.BAT as follows:

C:\DOS\MSCDEX.EXE /D:MSCD001

And reboot...

DSC05323

Out with the old and in with the new!

DSC05330

Meanwhile, Windows 98se kept locking up (whole machine freeze!) at Programs on the Start Menu. I actually had to unplug the CD drive and reboot to get it to continue! But the end result was lovely...

DSC05326

Time to really make this motherboard fit!

Filed under: Retro No Comments
14Nov/180

IBM PS/55 Z – All About The Pentiums

Found this at the local flea market on the weekend. After spending many nights replacing the guts of my IBM PS/55Z with a 486 DX2/66, I saw the specifications of this motherboard and couldn't resist snatching it up. 166mhz! PCI! ATX! 96mb RAM! USB! What more could you ask for in a vintage machine? I wonder if I should try and make it fit!?

DSC05301

Turns out it's the motherboard from a Compaq Deskpro 2000. Am I happy to have the Compaq splash screen display when the machine powers up? I believe the BIOS will also be tricky to get into as these machines need a separate hidden partition with Compaq's proprietary tools?

DSC05310 DSC05311 DSC05313

DSC05304

A quick Google lead me to realise that building an AT to ATX adapter would be a nightmare. I'd need to create a solid +3.3v DC supply from the 5v rails and also muck around with more sense wires? Might be easier to just rip out the power supply and slap an ATX unit in there. Would have to merge in the CRT electronics though... Of course, it's also ever-slightly too long, so there'd need to be quite a bit of hacking to make it fit.

Such delight at finding this beautiful piece of equipment! ... Oh wait, maybe this will be easier than expected!

Filed under: Retro No Comments
26Oct/180

How To Actually Connect An External MIDI Device

I started this journey thinking that MIDI cables were really simple. There's a joystick-style plug at one end and two DIN-5s at the other for MIDI-OUT and MIDI-IN. MIDI output from the computer comes out the OUT cable and MIDI you're receiving from elsewhere comes into the computer on the IN cable.

So, when you're hooking up an external module, like this MT-100, you simply connect them up...

DSC05206

There they go, OUT to IN and IN to OUT. Right? You want the output from the PC (be that the soundtrack of a game) to go into the Synth/Module to be processed. Like so... I don't really care about the module output at this point, but for-neatness-sake, let's plug it in!

DSC05207

IT TURNS OUT YOU DON'T WANT TO DO THIS. You're actually creating a loop and the MIDI data will come straight back out of the module and into the PC. This will then cause all matter of DMA/IRQ interrupts and you'll probably freeze your machine. I've actually just spent the greater part of two nights having DOOM II lock up every time I set both SB16 and MIDI-OUT. I went through all matter of IRQ or DMA settings, thinking the combination of a SCSI card, Network card and Sound card were fighting. After a quick google of vogons, I realised that the machine was freezing/slowing-down/locking-up due to the rebounding MIDI data!

This article was actually going to be titled 'DOOM II Freezes when selecting SB16 and MIDI-OUT'. Either way, do this instead... connect OUT (from the PC) to IN (on the module)...

DSC05213

And you'll be an uncle's monkey!

Filed under: Retro No Comments
25Oct/180

Ahhh… Floppies

There's nothing like the smell from a fresh box of floppies. That acrid plastic fragrance, reminding you how technologically advanced these little wonders are...

DSC05190

DSC05191 DSC05192 DSC05194

I recently found this box for a dollar at a local tip shop. Over the moon, I thought I could finally build a solid set of DOS 6.22 and other disks. I even got labels! Of differing colours!

DSC05199

Of course... none of them worked... They'd neither be read, formatted or imaged. I assume that fresh smell of acrid plastic meant that these had all been toasted by the sun at some point.

DSC05200

In the bin they go... Or maybe I should make some art.

Filed under: Retro No Comments