Bacalah

Learning is forever

RSS Feed

Going where this year?

Monthly Archives: January 2011

Insert Data Biner dan Menampilkannya di LCD pake CodevisionAVR

4 Comments

Karena ATMega32 yang langka dan saya punyanya ATMega16, saya memutuskan untuk mengconvert program line follower saya ke C. Di C, memori programnya lebih sedikit, sekitar 50% dari Bascom. Tapi saya menemukan kesulitan ketika mau masukin data biner sensor ke variabel (misalnya kita namain sensor)

Kalo di Bascom kan perintahnya bisa gini

If Dataadc0 > Vref0 Then
Sensor.0 = 1
End If
If Dataadc0 < Vref0 Then
Sensor.0 = 0
End If
di Codevision gak bisa gitu. Terus kalo mau nampilin data nya di lcd 16×2 tinggal gini

lcd bin(sensor)

Dan ternyata itu fungsi bawaan dari Bascom.

Setelah saya konsultasi sama Mas Eju, Mas Trianto, dan Andra, akhirnya saya dapet pencerahan. Untuk masukin data biner, tu gini kalo di Codevision

for(i=0;i<8;i++)
{
if (dataadc[i] > vref[i])
{
sensor|=1<<i;
}

if (dataadc[i] < vref[i])
{
sensor&=~(1<<i);
}
}

Dan untuk menampilkannya di lcd, kita bikin fungsi sendiri

void lcd_bin(unsigned char databyte)
{
register unsigned char i;
unsigned char buff[8];

for (i=0;i<8;i++)
{
if ((databyte &(1<<i))==0)
{
buff[i]=48;
}
else
{
buff[i]=49;
}
}

for (i=8;i>0;i–)
{
lcd_putchar(buff[i-1]);
}
}

dan cara pakai fungsinya tinggal gini

lcd_bin(sensor);

Hehehe. Makasih banyak buat para master yang sudah ngebantuin saya. Ternyata coding pake C lebih fleksibel dan menyenangkan, karena kita bisa berkereasi bikin fungsi2 sendiri tanpa bergantung banget sama si compiler.

Jan 7, 2011

Software Project bagi beberapa orang

3 Comments

Just a joke. To our friends who are software (and hardware) developer. Enjoy 🙂

Filed under Linux, My thoughts, Web
Jan 4, 2011

How to make Google as Your default search engine in Linux Chromium

1 Comment

Chromium automatically saves a list of the search engines you’ve come across while browsing the Web. For example, if you visit http://www.youtube.com, the browser automatically detects and adds the YouTube search engine to the list of search engines that you can access from the address bar.

To manually add, edit, or remove search engines from the browser, follow these steps:

  1. Click the wrench icon wrench icon on the browser toolbar.
  2. Select Preferences.
  3. Click the Basics tab.
  4. Click Manage in the “Default search” section.

Use the buttons in the dialog to manage the search engines in the list. You’ll need to provide the following information for each search engine:

  • Name: Nickname for the search engine.
  • Keyword: A text shortcut for the search engine. Use the shortcut to do keyword searches.
  • URL: The web address for the search engine. Learn how to find this URL
    1. Go to the search engine you want to add.
    2. Do a search.
    3. Copy and paste the web address of the search results page into the URL field. Keep in mind that the URL for the search results page is different from the website URL. For example, while you’d go to http://www.google.com to access Google, the URL you’d add here is for the search results page, http://www.google.com/search?q=XYZ.
    4. Replace the search term in the URL with %s. To continue the Google search engine example, you’d end up with http://www.google.com/search?q=%s as your final search engine URL. When you type a search in the address bar, %s will automatically be replaced by your search term.
Filed under Linux, Web
Jan 3, 2011

2011

0 Comments

Filed under Uncategorized
Jan 3, 2011

Acadia, I’m coming in 2012

0 Comments

Filed under My dream, My thoughts
Jan 3, 2011