Sunday, June 16, 2013

Raspberry Pi and Arduino (Gertboard) serial communication

A serial communication between Raspberry pi and Gertboard's ATMEGA328p chip
Remember both system work at 3.3 V.
NEVER CONNECT RASPBERRY PI and ARDUINO DIRECTLY.
But if you have Gertboard, Atmega328p on Gertboard is working on 3.3V
There are two codes, one for Arduino, the other for Raspberry Pi

Also remember the Jumpers

  • J7 - 3.3V jumper should be inserted
  • Jumper - between MCTX-GP15
  • Jumper - between MCRX-GP14



-----------------------This is the code for Arduino-----------------------------------------

char incomingByte=0;
char inData[20];
int x=0;
 void setup() {
  // initialize serial:
  Serial.begin(9600);
}
 void loop() {
    Serial.print("hello print");
    x=0;
    while (Serial.available()>0){
      incomingByte=Serial.read();
      inData[x]=incomingByte;
      inData[x+1]='\0';
      x++;
    }
    Serial.println(inData);
    delay(1000);
}
-----------------------------------------------------------------------------------------------------

And there is the code for Raspberry Pi based on Python
-----------------------This is the code for Raspberry Pi-----------------------------------------


from time import gmtime, strftime
import time
import serial
import struct
ser = serial.Serial(‘/dev/ttyAMA0‘, 9600)

while 1:
        ser.write(“testing”)
        temp=strftime(“%Y-%m-%d %H:%M:%S”, gmtime())+'\t'+ser.readline()
        print(temp)
        time.sleep(1)
-----------------------------------------------------------------------------------------------------



Sunday, February 24, 2013

Nautilus desktop problem in Openbox

If you are using Openbox and if time to time nautilus blocks your menus; you should just type this in the terminal:

gsettings set org.gnome.desktop.background show-desktop-icons false
do not run with "sudo" since you want to change the settings for the current user



Wednesday, January 02, 2013

Ubuntu-Wine Office 2003 and 2007 together

From now on, I will post my experiences on Ubuntu, so I can find my solutions to problems later on...
My first post is on having Office 2003 and Office 2007 on Ubuntu with Wine 1.5.

Every time I open Word 2003 after 2007 or vice versa, it tries to reinstall certain files. It was annoying...
Here is a good solution that worked for me:

From terminal write
regedit

The opening window is the classic regedit we have on windows
In the Regedit window select:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options

Then from the menu:
Edit>New> DWORD value
add NoReReg with value 1
So my line looks like
NoReReg        REG_DWORD     0x00000001 (1)
Do the same for
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Options