About bentech4u

To convert MIDI files into Arduino sketches

The intention of this experiment to play MIDI tones by using Arduino. This is very easy with some resistors and one speaker.

The components which used are:

1. Arduino UNO

2. Three 470 Ohm Resistors

3. one speaker/buzzer

 

First thing we need to take some midi sound files .eg: http://www.midiworld.com/download/3826  This is James Bond movie tone.Next thing we need to convert it into Arduino Sketch. For that we need one special software called Miditones. Download latest MidiTones .exe file. This is a command line utility. create one folder and copy-paste Miditones.exe and .midi file which we downloaded earlier .

Nov.17

Some Useful Linux Commands

  1.  Linux Sed command to change values inside file

# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config

 

  1. PERL script to check Linux machine type

# perl -MConfig -e ‘print “$Config{myarchname}\n”;’

 

  1. To check Fibre cable status – Simple script

checkfiber.sh
#!/bin/sh
ls /sys/class/fc_host | while read i; do
echo $i
cat /sys/class/fc_host/$i/port_state
done

Nov.12

Linux Tips and Tricks

Delete files that are ‘X’ days old

Sometimes ins linux, you want to clear out older files in a directory. One example could be if you have a security system and it continuously writes video files to a directory on your NAS until it fills it up.you have figured out that it keep a week’s collections of videos, there will be plenty of space for other users. So, here is a command that will delete all files that are older than seven days . So remember to execute this command with caution as it can delete your important data if not used correctly

 

#find /path/to/files/ -type f -mtime +7 -exec rm -rf {} \;

 

find : This command will search for files.
/path/to/files : This is the top level directory to start searching
-type f : This ensures we don’t remove directories , but only files.
-mtime +7 : Removes files older than ‘7’ days. Change to ‘+14’ to delete files older than two weeks.
-exec : This indicates what to do with files we found.
rm -rf  :  Removes the files recursively and forcefully.
{} : This represents each file we find.
\; : This is the end of exec.
 
On successfully testing the above command you can create a Cron job to automate this task

Burning ATmega 328P-PU boot loader from Raspberry PI

Hi Friends. Welcome to new blog design.I lost all my old blog entries bcoz of server migration.Also this is my 1st post after moving to new company.before all my topics was related to Linux . nowadays I am too much interested in doing electronics projects with AVR.

I took 2 Arduino’s from india and all of sudden one of then is not responding to IDE instructions. Then i was digging through forums and finally came to know that it’s because of corrupted boot loader.I requested some sample chips from Atmel, and they send nearly 6 ATmega 328p chips to my kuwait home address.i thought of install bootloader to the new chips so that i can re use my Arduino.

 

BootLoader:
Microcontrollers are usually programmed through a programmer. This is a piece of hardware you’ll have to make or build…. Unless…. you have a program in your microcontroller that allows installing new firmware without such an external programmer. This piece of software is called a bootloader.

when i started reading this, i thought of install bootloader from another Arduino board. I tried Arduino as ISP method on IDE and that method got failed.Then i tried with my USBAsp programmer, same issue. i am always getting error message on IDE that chip is not responding. And in my connection, i used 15.468 MHZ crystal instead of 16. The thing is it’s very difficult to find electronics components in Kuwait. Also sometimes we won’t get items shipped from out side .