Belajar Bahasa Arab 03: laa, lam, maa, lan, laisa

LAM dan LAA ( لم لا )

hanya dipakai untuk Kata Kerja Sekarang, sedangkan ( ما ) maa biasanya dipakai untuk Kata Kerja Lampau

Secara kaidah grammar, LAA titerapkan yang huruf terakhirnya di dhommah. Misal:

Saya tidak faham : انا لا أفهم- ana laa afhamu

sedangkan sesudah LAM, huruf terakhir di sukun. Sehingga penulisannya:

Saya tidak faham: انا لم أفهم - ana lam afham

(menurut sebagian orang, LAM itu Tidak nya bersifat MUTLAK)

 

MAA

dipakai untuk Kata Kerja Lampau.

Saya sudah paham : فهمتُ - fahimtu
Saya tidak sudah paham : ما فهمتُ - maa fahimtu

Catatan bahasa Indonesia “Saya tidak sudah paham” agak membingungkan mungkin, padanan bahasa Inggrisnya: I have not understood.

 

LAN

adalah meniadakan peristiwa/pekerjaan akan datang

Tidak akan berhenti: لَنْ نَبْرَح - LAN NABROHA

LAISA (M) atau LAISAT (F)

digunakan untuk kalimat non verbal (bukan kata kerja):

Ceritanya tidak menarik: ليست القصة ممتعة - laisat al-kessatu momte'a

LAISA untuk kata keterangan orang ditambahi TA/NA, bisa menjadi LASTU (saya tidak), LASTA (kamu tidak – M), LASTI (kamu tidak – F), LASNA (kami tidak)

 

Sumber:

  • http://arabquran.blogspot.co.id/2007/10/topik-47-latihan-surat-al-ikhlas-ayat-3.html
  • http://www.everyday-arabic.com/2013/12/negation-in-arabic-language.html
  • https://nahwusharaf.wordpress.com/2012/04/13/fiil-mudhari-manshub-sebab-amil-nawashib-lan-kay-an-%D9%84%D9%86-%D9%83%D9%8A-%D8%A3%D9%86-alfiyah-bait-677-678/

Belajar Bahasa Arab 02: na’am, balaa, dan labbaika

Apa persamaan dan perbedaan dari kata na’am, balaa, dan labbaika?

نعم, بلى, لبّيك

Persamaan: ketiga kata ini umumnya digunakan oleh seseorang untuk menyahut/menjawab orang yang memanggilnya.

Perbedaan: ketiga kata ini berbeda dalam aspek tata krama bahasa. Penjelasannya diberikan dalam ilustrasi berikut.

Sahabat Nabi rodhiyallohu ‘anhu:

  • Bila dipanggil oleh sesama kawan, beliau menjawab dengan na’am
  • Bila dipanggil oleh Nabi, beliau menjawab dengan balaa
  • Bila ‘dipanggil’ oleh Alloh (misal, perintah untuk haji), beliau menjawab dengan labbaika

Dari ilustrasi ini, kita ketahui bahwa:

  • Na’am: untuk kawan sebaya
  • Balaa: untuk orang yang lebih tua, pemimpin, ulama, dan semisalnya
  • Labbaika: untuk Alloh khususnya

sumber: http://www.mnurq.ga/2014/01/naam-balaa-dan-labbaika.html

Contoh bridging BPJS dengan PHP (Contoh Formulir request dan response)

Berikut contoh bridging BPJS dengan PHP, mencakup:

Referensi
Kode atau Nama Diagnosa
Pencarian data poli
Fasilitas Kesehatan

Kepesertaan
Berdasar NIK
Berdasar No. Kartu

SEP
Detail SEP Peserta
Monitoring Verifikasi Klaim
Data Kunjungan Peserta
Data Riwayat Pelayanan Peserta
Integrasi SEP dengan Inacbg 4.1

Pada contoh ini terdiri dari 2 file, yaitu getform.php sebagai contoh formulir dan getresponse.php sebagai skrip untuk request ke server BPJS

File form (contoh formulir): getform.php

<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

<script>
  $( function() {
      
    $( "#tglMasuk" ).datepicker({
        dateFormat: "yy-mm-dd"
    });
    $( "#tglKeluar" ).datepicker({
        dateFormat: "yy-mm-dd"
    });
    
  });
</script>
  
<script>

$(document).ready(function(){

    
    $("#DIAG").click(function(){
        var parameter = $('#paramDIAG').val();
        if (parameter==""){alert ("Diagnosa harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/diagnosa/ref/diagnosa/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });

     $("#POLI").click(function(){
        var parameter = '';
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/poli/ref/poli&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });

    $("#FASKES").click(function(){
        var parameter = $('#paramFASKES').val();
        var mulai = $('#mulaiFASKES').val();
        var limit = $('#limitFASKES').val();
        var uri = "&start="+mulai+"&limit="+limit;
        var url="getresponse.php?parameter="+parameter+encodeURIComponent(uri)+"&arr=1&cat=/provider/ref/provider/query%3Fnama=";  //tanda ? --> url encode mjd %3F
        if (parameter==""){alert ("FASKES harus diisi"); return;}
        $("#div1").load(url, 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });


    $("#NIK").click(function(){
        var parameter = $('#paramNIK').val();
        if (parameter==""){alert ("NIK harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/Peserta/Peserta/nik/&arr=1", 
        function(responseTxt, statusTxt, xhr){
       if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });
    
    $("#NO").click(function(){
        var parameter = $('#paramNO').val();
        if (parameter==""){alert ("No. Kartu harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/Peserta/Peserta/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });    
    
     $("#DETSEP").click(function(){
        var parameter = $('#paramDETSEP').val();
        if (parameter==""){alert ("SEP harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/SEP/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });
    
    
    
     $("#VERSEP").click(function(){
        var parameter = "tglMasuk/" + $('#tglMasuk').val() + "/tglKeluar/" + $('#tglKeluar').val() + "/KlsRawat/" + $('#kelas').val() + "/Kasus/" + $('#kasus').val() + "/Cari/" + $('#cari').val() + "/status/" + $('#status').val();    
        if (parameter==""){alert ("SEP harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/sep/integrated/Kunjungan/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });
    
    
   $("#SEPKUN").click(function(){
        var parameter = $('#paramSEPKUN').val();
        if (parameter==""){alert ("SEP harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/sep/integrated/Kunjungan/sep/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });
    
   $("#NOR").click(function(){
        var parameter = $('#paramNOR').val();
        if (parameter==""){alert ("No Kartu harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/sep/peserta/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
    });
    
   $("#CBG").click(function(){
        var parameter = $('#paramCBG').val();
        if (parameter==""){alert ("SEP harus diisi"); return;}
        $("#div1").load("getresponse.php?parameter="+parameter+"&cat=/sep/cbg/&arr=1", 
        function(responseTxt, statusTxt, xhr){
        if(statusTxt == "error")
            alert("Error: " + xhr.status + ": " + xhr.statusText);
        });
        
    });
    
    $("button").click(function(){
        $("html, body").animate({ scrollTop: 0 }, "slow");
    });

    
});
</script>
</head>
<body>
<div id="div1"><h2>Hasil akan tampil disini</h2></div>
<hr />

<h2> Referensi</h2>
<h3> Diagnosa</h3>
<p> Kode atau Nama Diagnosa: <input type="text" id="paramDIAG"  value=""/>
<button id="DIAG">Kirim</button></p>

<h3> Poli</h3>
<p> Pencarian data poli: 
<button id="POLI">Kirim</button></p>

<h3> Fasilitas Kesehatan</h3>
<p> Nama atau kode faskes: <input type="text" id="paramFASKES"  value=""/>
<button id="FASKES">Kirim</button><br />
 Mulai: <input type="text" id="mulaiFASKES"  value="0"/><br />
 Limit: <input type="text" id="limitFASKES"  value="7"/>
</p>

<hr />

<h2> Kepesertaan </h2>
<h3> Berdasar NIK </h3>
<p> NIK: <input type="text" id="paramNIK"  value=""/>
<button id="NIK">Kirim</button></p>

<h3> Berdasar No. Kartu </h3>
<p> No.Kartu BPJS: <input type="text" id="paramNO"  value=""/>
<button id="NO">Kirim</button></p>

<hr />
<h2> SEP </h2>

<h3> Detail SEP Peserta </h3>
<p> No.SEP: <input type="text" id="paramDETSEP"  value=""/>
<button id="DETSEP">Kirim</button></p>

<h3> Monitoring Verifikasi Klaim </h3>
<p> 
Tanggal Masuk: <input type="text" id="tglMasuk"  value=""/><br />
Tanggal Keluar: <input type="text" id="tglKeluar"  value=""/><br />
Kelas rawat: <select id="kelas" required>
   <option selected="selected" value="">Pilih</option>
  <option value="1">Kelas 1</option>
  <option value="2">Kelas 2</option>
  <option value="3">Kelas 3</option>
</select><br />
JnsPelayanan : <select id="kasus" required>
   <option selected="selected" value="">Pilih</option>
  <option value="1">Rawat inap</option>
  <option value="2">Rawat jalan</option>
</select><br />
Cari berdasar : <select id="cari" required>
   <option selected="selected" value="">Pilih</option>
  <option value="0">Tanggal masuk</option>
  <option value="1">Tanggal keluar</option>
</select><br />
Status  : <select id="status" required>
   <option selected="selected" value="">Pilih</option>
  <option value="00">Klaim Baru</option>
  <option value="10">Klaim Terima CBG</option>
  <option value="21">Klaim Layak</option>
  <option value="22">Klaim Tidak Layak</option>
  <option value="23">Klaim Pending</option>
  <option value="30">Terverifikasi</option>
  <option value="40">Proses Cabang</option>
</select><br />
<button id="VERSEP">Kirim</button><br />
</p>

<h3> Data Kunjungan Peserta </h3>
<p> Nomor SEP: <input type="text" id="paramSEPKUN"  value=""/>
<button id="SEPKUN">Kirim</button></p>

<h3> Data Riwayat Pelayanan Peserta </h3>
<p> No.Kartu BPJS: <input type="text" id="paramNOR"  value=""/>
<button id="NOR">Kirim</button></p>

<h3> Integrasi SEP dengan Inacbg 4.1 </h3>
<p> Nomor SEP: <input type="text" id="paramCBG"  value=""/>
<button id="CBG">Kirim</button></p>

</body>
</html>

File response: getresponse.php

<?php

if(!isset($_GET["parameter"])) exit(0);
if(!isset($_GET["cat"])) exit(0);
$printarr=false;
if(isset($_GET["arr"])) $printarr=true;
$extraparam="";
if(isset($_GET["extraparam"])) $extraparam=$_GET["extraparam"];

$parameter = $_GET["parameter"];
$cat = $_GET["cat"];

$dataid    = "1234"; //Ganti dengan consumerID dari BPJS
$secretKey = "5678"; //Ganti dengan consumerSecret dari BPJS
$localIP   = "dvlp.bpjs-kesehatan.go.id";
$port      = 8081; //port url
$url       = "http://".$localIP.":".$port."/devwslokalrest".$cat.$parameter; //Lihat katalog, jangan sertakan port

date_default_timezone_set('UTC');
$tStamp = strval(time()-strtotime('1970-01-01 00:00:00'));
$signature = hash_hmac('sha256', $dataid."&".$tStamp, $secretKey, true);
$encodedSignature = base64_encode($signature);
$urlencodedSignature = urlencode($encodedSignature);

/*
echo "X-cons-id: " .$dataid ."<br>";
echo "X-timestamp:" .$tStamp ."<br>";
echo "X-signature: " .$encodedSignature."<br>";
*/

$opts = array(
 'http'=>array(
 'method'=>"GET",
 'header'=>"Host: api.asterix.co.id\r\n".
 "Connection: close\r\n".
 "X-timestamp: ".$tStamp."\r\n".
 "X-signature: ".$encodedSignature."\r\n".
 "User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64)\r\n".
 "X-cons-id: ".$dataid."\r\n".
 "Accept: application/json\r\n"
 )
);

$context = stream_context_create($opts);
$url=$url.$extraparam;
$result = file_get_contents($url, false, $context);

//echo "<br>Respon:";
if ($result === false) 
{ 
 echo "Tidak dapat menyambung ke server"; 
} else { 
 echo $result;
 if($printarr==true){
    echo "<pre>";
    print_r(json_decode($result, true)); 
    echo "</pre>";

    /*
    //contoh penggunaan array untuk menampilkan peserta
    $resultarr = json_decode($result, true);
    echo "Nama :". $resultarr['response']['peserta']['nama'] ."<br />";
    echo "Nik  :". $resultarr['response']['peserta']['nik'] ."<br />";
    echo "Lahir:". date("d-m-Y", strtotime($resultarr['response']['peserta']['tglLahir'])) ."<br />";
    echo "Usia :". $resultarr['response']['peserta']['umur']['umurSekarang'] ."<br />";
    echo "#Krtu:". $resultarr['response']['peserta']['noKartu'] ."<br />";
    echo "Sex  :". $resultarr['response']['peserta']['sex'] ."<br />";
    */
 }
}

?>

 

 

Contoh bridging BPJS dengan PHP (Update SEP)

<?php

$dataid = "1234"; //Ganti dengan consumerID dari BPJS
$secretKey = "5678"; //Ganti dengan consumerSecret dari BPJS
$localIP = "dvlp.bpjs-kesehatan.go.id";
$url = "http://".$localIP."/devwslokalrest/SEP/update"; //Lihat katalog, jangan sertakan port
$port = 8081; //port url

date_default_timezone_set('UTC');
date_default_timezone_set('Asia/Jakarta');

$tStamp = strval(time() - strtotime('1970-01-01 00:00:00'));
$signature = hash_hmac('sha256', $dataid . "&" . $tStamp, $secretKey, true);
$encodedSignature = base64_encode($signature);
$urlencodedSignature = urlencode($encodedSignature);

echo "X-cons-id: " . $dataid . "<br>";
echo "X-timestamp:" . $tStamp . "<br>";
echo "X-signature: " . $encodedSignature . "<br>";

function post_request($url, $port, $dataid, $tStamp, $encodedSignature, $data, $referer = '')
{
 
 //-Convert the data array into URL Parameters like a=b&foo=bar etc.
 //$data = http_build_query($data);
 
 // parse the given URL
 $url = parse_url($url);
 
 if ($url['scheme'] != 'http') {
 die('Error: Only HTTP request are supported !');
 }
 
 // extract host and path:
 $host = $url['host'];
 $path = $url['path'];
 
 // open a socket connection on port 80 - timeout: 50 sec
 $fp = fsockopen($host, $port, $errno, $errstr, 50);
 
 if ($fp) {
 
 // send the request headers:
 fputs($fp, "PUT $path HTTP/1.1\r\n");
 fputs($fp, "Host: $host\r\n");
 
 if ($referer != '')
 fputs($fp, "Referer: $referer\r\n");
 
 fputs($fp, "x-cons-id: " . $dataid . "\r\n");
 fputs($fp, "x-timestamp: " . $tStamp . "\r\n");
 fputs($fp, "x-signature: " . $encodedSignature . "\r\n");
 fputs($fp, "Content-Type: application/x-www-form-urlencoded\r\n");
 fputs($fp, "Content-length: " . strlen($data) . "\r\n");
 fputs($fp, "Connection: close\r\n\r\n");
 fputs($fp, $data);
 
 $result = '';
 while (!feof($fp)) {
 // receive the results of the request, 128 char
 $result .= fgets($fp, 128);
 }
 } else {
 return array(
 'status' => 'err',
 'error' => "$errstr ($errno)"
 );
 }
 
 // close the socket connection:
 fclose($fp);
 
 // split the result header from the content
 $result = explode("\r\n\r\n", $result, 2);
 
 $header = isset($result[0]) ? $result[0] : '';
 $content = isset($result[1]) ? $result[1] : '';
 
 // return as structured array:
 return array(
 'status' => 'ok',
 'header' => $header,
 'content' => $content
 );
 
}


$databpjs = '{
 "request":
 {
 "t_sep":
 {
 "noSep":"0301R00105160000579",
 "noKartu":"0000015223579",
 "tglSep":"2016-06-12 09:00:00",
 "tglRujukan":"2016-06-12 09:00:00",
 "noRujukan":"00009",
 "ppkRujukan":"00010009",
 "ppkPelayanan":"0301R009",
 "jnsPelayanan":"2",
 "catatan":"test",
 "diagAwal":"A00.1",
 "poliTujuan":"INT",
 "klsRawat":"3",
 "lakaLantas":"2",
 "lokasiLaka":"Banyumas",
 "user":"RS",
 "noMr":"001"
 }
 }
 }';

$data = array(
 'Data' => $databpjs
);


$result = post_request($url, $port, $dataid, $tStamp, $encodedSignature, $databpjs, $referer = '');
if ($result['status'] == 'ok') {
 // Print headers
 echo $result['header'];
 
 echo '<hr />';
 
 //mengubah "re d sponse" menjadi "response"
 $resultstr = str_replace("re d sponse", "response", trim(preg_replace('/\s\s+/', ' ', $result['content'])));

 //mengubah format ke JSON yang valid
 $pos = strpos($resultstr, "{");
 if ($pos === false) 
 $pos = 0;
 $rpos = strrpos($resultstr, "}");
 if ($rpos === false) 
 $rpos = strlen($resultstr);
 $resultstr = substr($resultstr,$pos,$rpos-$pos+1);
 
 // print the result of the whole request:
 echo "<pre>";
 echo $resultstr;
 echo "</pre>";
 
} else {
 echo 'A error occured: ' . $result['error'];
}

?>

Compile x86 (32 bit) pada Visual studio x64 (64 bit)

Secara bawaan, Visual Studio akan meng-compile platform sama dengan jenis sistem operasinya. Jika menggunakan platform x64, maka hasil compilasinya juga x64. Bagaimana cara compile program x86 (32 bit) pada Visual studio yang dijalankan di Windows x64 (64 bit)

Buka: Tools > Options

pilih “Show all settings”

Arahkan ke “Projects and Solutions > General” dan tandai (centang) “Show advanced build configurations”

setelah klik OK, maka muncul pilihan x64 dan x86 pada drop-down.

Source: http://captain-slow.dk/2010/07/12/build-in-x86-on-a-x64-platform-with-microsoft-visual-c-2010-express/

Cara membuka acakan siaran parabola jenis BISS

Langkah pertama: Mencari PID

Setelah siaran yang diacak direkam dalam bentuk TS (Transport Stream), lalu buka file melalui TSReader. Cari PID tayangan yang diacak. PID ditampilkan dalam format Hexadesimal. Untuk mengetahui dalam bentuk desimal, gunakan kalkulator dengan mode scientific. (Misal: 0x0031Hex = 49 Dec)

Langkah kedua: Brute dengan CW Finder

  • Buka file dan masukkan PID dalam bentuk desimal (Misal: 49)
  • Pilih menu Pilihan lanjut pilih Gunakan file daftar serangan
  • Buka file daftar kunci, klik Baca File, OK pada jendela Info, centang pada Gunakan daftar serangan, dilanjutkan dengan klik Gunakan pada jendela Daftar serangan CW
  • Semua jendela akan menutup otomatis
  • Klim menu Mulai, tunggu sebentar hingga muncul kode CW
Search Thread started...
CW found: 
A3 B2 C1 [16] D6 E5 F4 [AF]
Search Thread stoped...
  • Tinggal isikan kode (misal yang ditemukan di atas adalah: A3B2C116D6E5F4AF pada receiver

Jika langkah kedua gagal, gunakan langkah ketiga

  1. Cari kode Crypt8 dengan CSA Rainbow Table
  • Siapkan dahulu file rbt, CSA_B8hx00h_10000h.rbt (untuk jenis MP2) atau CSA_B8hxFFh_10000h.rbt (untuk jenis MP4)
  • Buka CSA Rainbow Table
  • Pada bagian TS file:, arahkan ke file TS
  • Pada bagian PID, isikan PIDnya (Misal: 49)
  • Klik tombol Start

csa

  • Pada contoh di atas, ditemukan 2 kode Crypt8, yaitu FD ED 27 37 23 ED 5E 5B dgn jumlah 231668 dan 08 E5 A3 EF F5 FB D5 78 dengan jumlah 34. Pilih yang jumlahnya paling banyak, yaitu: FD ED 27 37 23 ED 5E 5B
  • Copy yang telah dipilih lalu paste ke bagian Crypt8: FD ED 27 37 23 ED 5E 5B
  • Arahkan RBT Dir: ke tempat dimana file rbt atau CSA_B8hx00h_10000h.rbt berada
  • Klik tombol Start, maka hasil CW akan ditampilkan di bagian CW:
  • Tinggal isikan kode (misal yang ditemukan di atas adalah: A3B2C116D6E5F4AF pada receiver

 

Referensi: satelitindonesia.com

Contoh kode interupsi I2S pada WAU8822 pada Nuvoton NUC-LB140

Contoh loopback dari dan ke WAU serta pembentukan sinyal sinusoida

#include "NUC100Series.h"
#include "gpio.h"
#include "portinit.h" //lcd
#include "lcd.h"
#include "wau8822n.h"

# define PLLCON_SETTING      CLK_PLLCON_50MHz_HIRC
# define PLL_CLOCK           50000000
# define HCLK_DIV            1

#define MUTE_OFF(x)         PE->DOUT &= ~(1 << 14)
#define MUTE_ON(x)          PE->DOUT |=  (1 << 14)

//#define POOLING
#define LOOPBACK 1
#define MONOTOSTEREO 1
#define GAIN 1//50

#define SIN_SAMPLES     32
int32_t i32SinIdx = 0;
int16_t i16Sin[SIN_SAMPLES] = {
    0,3203,6284,9124,11612,13655,15172,16106,16423,16107,15172,13655,
    11613,9124,6284,3204,1,-3205,-6284,-9124,-11613,-13654,-15173,-16107,
    -16422,-16106,-15172,-13655,-11613,-9123,-6285,-3203
};

uint32_t g_u32TxValue;
uint32_t connect=TRUE;
void displayLCD(){

    //PC15=0;
    print_Line(0,   " Teknik Elektro ");
    printS(2*8+4,1*16,"Universitas"); //printS(x, y, char)
    printS(2*8,2*16,"Muhammadiyah");
    printS(3*8,3*16, "Purwokert0");
    connect=FALSE;

}

uint32_t spectrum[128];
volatile uint8_t ii=0;
extern void wau(void){
    uint8_t i;
    for(i=0;i<128;i++){
        spectrum[i]=0;
    }


    SYS_UnlockReg(); // Unlock protected registers
    CLK_EnableXtalRC(CLK_PWRCON_XTL12M_EN_Msk | CLK_PWRCON_OSC10K_EN_Msk ); // Enable HXT external 12MHz cyrstal
    CLK_SetCoreClock(50000000);    //  Set HCLK frequency 50MHz
    SYS_LockReg(); // Lock protected registers

    Port_Init(SPI3PORT);
    init_LCD();
    clear_LCD();

    //I2C - I2S WAU8822 codec
    WAU8822_Config();

    GPIO_SetMode(PE, BIT14, GPIO_PMD_OUTPUT);
    PE14=0;  //PHone OUT Enable (NUC-LB-140)

#ifdef POOLING
    //uint32_t u32Tmp;

    //open I2S function
    //st.u32SampleRate     = 16000;
    //st.u8WordWidth       = I2S_DATABIT_16;
    //st.u8AudioFormat     = I2S_STEREO;
    //st.u8DataFormat      = I2S_FORMAT_I2S;
    //st.u8Mode            = I2S_MODE_SLAVE;
    //st.u8TxFIFOThreshold = I2S_FIFO_TX_LEVEL_WORD_0;
    //st.u8RxFIFOThreshold = I2S_FIFO_RX_LEVEL_WORD_8;//SMP_ONE
    I2S_Open(I2S,I2S_MODE_MASTER,32000,I2S_DATABIT_16,I2S_STEREO,I2S_FORMAT_I2S);

    // Set MCLK and enable MCLK
    I2S_EnableMCLK(I2S,6000000);

    while(1)
    {

            if((I2S->STATUS & I2S_STATUS_TXFULL_Msk) == 0)
            {
                u32Tmp = i16Sini[i32SinIdxi];
                u32Tmp &= 0xFFFFUL;
                //u32Tmp |= u32Tmp << 16;  //duplicate it to stereo to Tx FIFO
                I2S->TXFIFO = u32Tmp;
                i32SinIdxi++;
                if(i32SinIdxi >= SIN_SAMPLESi)
                    i32SinIdxi = 0;

            }

    }
#else

    //interrupt
    I2S_Open(I2S,I2S_MODE_SLAVE,32000,I2S_DATABIT_16,I2S_STEREO,I2S_FORMAT_I2S);
    I2S_EnableMCLK(I2S,12000000);

    I2S_EnableInt(I2S,I2S_IE_RXTHIE_Msk );
    NVIC_EnableIRQ(I2S_IRQn);

    GPIO_SetMode(PC,BIT12,GPIO_PMD_OPEN_DRAIN);PA12=1;
    GPIO_SetMode(PC,BIT14,GPIO_PMD_OPEN_DRAIN);

    if(PE15==1) displayLCD();

    while(1)
    {
        CLK_SysTickDelay(1000000);
        if(PE15==0)
        {
            if(connect==FALSE) {
                clear_LCD();
                print_Line(0,   "Line-In Sound OK");
            }
            PC12 ^= 1;  //in LIN connected
            connect=TRUE;


        }else{
            if(connect){displayLCD();}

        }


    }
#endif
}

void I2S_IRQHandler(void)
{
    uint32_t u32Tmp=0;
    //unit32_t s =

    /* Fill sin samples to I2S until Tx FIFO full */
    while((I2S->STATUS & I2S_STATUS_TXFULL_Msk) == 0)
    {

#if LOOPBACK // Just loop Rx FIFO to Tx FIFO
        u32Tmp = I2S->RXFIFO;
        I2S->TXFIFO = (u32Tmp*GAIN);
#elif MONOTOSTEREO // Mono data in Rx FIFO and duplicate it to stereo to Tx FIFO
        u32Tmp = I2S->RXFIFO*GAIN & 0xFFFF0000UL;
        u32Tmp |= u32Tmp >> 16;
        I2S->TXFIFO = u32Tmp;

#else // Output Sin Wave
        u32Tmp = i16Sin[i32SinIdx];
        u32Tmp &= 0xFFFFUL;
        u32Tmp |= u32Tmp << 16;
        I2S->TXFIFO = u32Tmp;
        i32SinIdx++;
        if(i32SinIdx >= SIN_SAMPLES)
            i32SinIdx = 0;
#endif
    }
    ii = u32Tmp;
    PC->DOUT ^= (1 << 14);
}

Membuat HTPC dengan Linux Ubuntu

So, what is HTPC?

HTPC is Home Theater PC, from the name it can be guess that HTPC is a Home Theater using PC (Personal Computer). This is how to make it work:

Install XBMCBuntu

Setup LIRC

Keluar dari xbmc, login pilih ubuntu

klik Dash Home (logo ubuntu kiri atas) lalu ketik term, pilih UXterm

jika belum punya lirc, ketik:

sudo apt-get install lirc setserial

cari daftar remote yang support, di http://lirc.sourceforge.net/remotes/ misalnya dipilih remote TV Sharp http://lirc.sourceforge.net/remotes/sharp/G1324SA download dan copy ke share, ketik:

wget http://lirc.sourceforge.net/remotes/sharp/G1324SA

sudo mkdir /usr/share/lirc/remotes/sharp

sudo cp G1324SA /usr/share/lirc/remotes/sharp

perbaiki file hardware.conf dengan ketik:

sudo nano /etc/lirc/hardware.conf

perbaiki dengan:

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="sharp" #isi dengan sharp atau nama remote apapun terserah
REMOTE_MODULES="lirc_dev lirc_serial" #tambahkan modul dev dan serial
REMOTE_DRIVER="default" #isi dengan default
REMOTE_DEVICE="/dev/lirc0" #defaultnya, cek dengan: ps ax | grep lirc
REMOTE_LIRCD_CONF="sharp/G1324SA" #isikan alamat conf remote yg tlh dicopy
REMOTE_LIRCD_ARGS=""

#tambahkan konfigurasi berikut
#ttyS0 berarti COM1 atau serial pertama, isikan ttyS1 jika COM2 dst
#lihat di ls /dev/ttyS*
#serial
COM_PORT=/dev/ttyS0  
DRIVER_OPTS="irq=4 io=0x3f8" #tergantung alamat dari serial
setserial /dev/ttyS0 uart none 

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

perbaiki file lircd, ketik:

sudo nano /etc/lircd.conf

tambahkan baris:

include “/usr/share/lirc/remotes/sharp/G1324SA” #sesuaikan dengan letak file conf remote

OK, sekarang reboot Lanjutkan dengan cek modul, ketik:

lsmod | grep lirc

ps ax | grep lirc

jika ada tulisan: /usr/sbin/lircd berarti sudah ok lakukan cek dengan irw, ketik:

irw

lalu pencet remote. Jika ada keterangan tombol yang dipencet berarti OK.

Saran:

Instal gedit, editor text grafis,biar edit file conf mudah (perlu konesi internet)  ketik:

sudo apt-get update

sudo apt-get install gedit

Troubleshoot:

1. Jika ada tulisan Cannot open /dev/ttyS0: permision denied berarti seting tty salah

2. Jika pada saat irw tidak keluar apa-apa, file conf remote salah, buat baru: Matikan lirc, ketik:

sudo -s

/etc/init.d/lirc stop

irrrecord –driver=default –device=/dev/lircd0 Remotku –disable-namespace

lalu ikuti petunjuk, hingga diminta set nama tombol pada saat tulisan please enter name bla bla bla. isikan nama tombol, misalnya POWER dan tekan tombol power pada remote. Ikuti dengan tombol lain dan terakhir tekan enter saja. copy hasil konfigurasi ke dir remote

cp Remotku /usr/share/lirc/remotes/

ganti alamat konfigurasi file hardware.conf dan lircd.conf dari /sharp/G1324SA menjadi Remoteku jalankan lirc kembali, ketik

/etc/init.d/lirv start -v

exit

irw

harusnya sudah muncul tombolnya! tekan ctrl+c untuk keluar

Konfigurasi XBMC

edit file lirc, ketik:

sudo nano /usr/share/xbmc/system/Lircmap.xml

Tambahkan:

<remote device=”sharp”>
<power>POWER</power>
<select>TV/VIDEO</select>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
<up>VOL+</up>
<down>VOL-</down>
<left>CH-</left>
<right>CH+</right>
<play>MENU</play>
<mute>MUTE</mute>
</remote>

 

Ways to detect heart rate

Based on Onitsch Cartoons, he can measure hetbeat using piezzoelectric by taped the sensor into his finger.

Its using arduino board and make it works great without noise. Here is the skecth:

Connect piezzoelectric into A2, or may another Analog input pin by change A2 code above into another Analog input. For fine result, it can be filterred and gained using following schematic. The schematic is from amgalbu whose post his article into element14 community. He is using oprocoupler instead of using piezzoelectirc

The basic idea is that the operational amplifier sums up Vcc/2 with the amplified DC component of the Vsensor. Vcc/2 is obtained through the R4/R5 partitor. The AC component is measured on the C5 capacitor. This signal is amplified by a factor of 330 (R1/R2). The RF1 trimmer will make it possible to fine-tune the gain (amgalbu)

I have not test it yet, but I’m sure it will be working great. I just need a time to check it out

Routing PCB dengan CNC (YOOCNC 3020ZD)

Buka File Layout

Buka file skema (.sch) dan juga board (.brd) dengan Eagle. Arahkan pada tampilan Board.
disarankan untuk mengubah latar belakang menjadi hitam dengan cara pilih menu

Option --> User Interface --> Pilih pada Layout--> Background --> Black.

Cek posisi dan kesalahan layout dengan DRC

Cek desain dengan DRC, pada menu tool –> DRC lalu isikan parameter jika diperlukan.

Penting: Untuk penggunaan VBit ukuran ujung 0.5 mm maka isikan di bagian clearance 20mil. untuk ujung 0.2 mm maka isikan di bagian clearance 10 mil. Jika sudah memunyai simpanan seting DRC, tinggal di-Load aja. Berikut contohnya: File DRC Yoo CNC

Klik tombol Check dan jika ada Error atau Warning akan muncul di bagian kanan bawah. Benahi  dahulu error! Jika yakin tidak ada masalah, maka dapat di klik tombol Clear All atau langsung ditutup.

Buat kode GCode dengan PCB GCode

Klik tombol dengan tulisan ULP (di bagian atas, di bawah menu library). Pilih file PCB-Gcode-Setup.ulp lalu buka setingan default pada menu tab GCode Style.

Penting: harus memilih software yang digunakan untuk CNC terlebih dahulu sebelum mengisi parameter. Jika memilihnya setelah mengisi parameter, maka isian parameter akan ter-reset!

Pada tab Generation Option: (pilih GCode yang akan dibuat, centang yang dipilih)
——————

  • Top Side: Layer atas
  • Outline: Guratan
  • Drill: Lubang
  • Bottom Side: Layer Bawah
  • Outline: Guratan
  • Drill: Lubang
  • Mirror: dibalik (gunakan fitur ini untuk YOOCNC, karena koordinat x+ dan x- mesin terbalik)
  • Show preview: tampilkan preview, isikan sesuai ukuran PCB
  • Generate milling: -1.27mm / sesuaikan dengan tebal PCB (pilihan ini untuk membuat GCOde milling/bentuk PCB sesuai layer 46. Tandai centang jika diperlukan)
  • Generate text: -0.127mm (pilihan untuk membuat GCOde guratan text yang ada pada layer 46. Tandai centang jika diperlukan)
  • Spot drill hole: -0.05mm (Tandai lubang pada PCB.  Gunakan jika akan dibor secara manual untuk memudahkan pengeboran. Jika dibor dengan CNC, tidak perlu ditandai, hilangkan tanda centang)
  • Isolation: centang single pass jika ingin sekali guratan saja. (Gunakan fasilitas singgle pass  ini untuk mengecek preview guratan)
  • Minimum: 0.005mm (isikan jarak guratan terdekat dengan jalur PCB)
  • Maximum: 0.5mm (Isikan dengan ukuran ujung bor/bits)
  • Stepsize: 0.127mm (isikan jarak antar guratan pertama dengan guratan selanjutnya)
  • Etching tool size: 0.20 (idealnya adalah ukuran ujung bor/bits, namun biarkan ke angka default)

Machine:
——–

  • Unit: Milimeter
  • Spin Up Time: 1 detik (Jeda waktu untuk spindle/bor berputar)
  • Feed rates:
    •     X Y: 500 mm/menit (kecepatan pindah spindle arah XY)
    •     Z: 180 mm/menit (kecepatan pindah spindle arah Z; mengebor)

Sesuaikan feed rates XY dengan kemampuan mesin. Lihat di Config -> Motor Tuning and Setup pada Mach3 dan cari bagian Velocity. Bagi nilai Velocity dengan 3 atau 4.Sesuaikan feed rates Z dengan ketajaman bor, semakin tumpul harus semakin kecil serta tidak melebihi kecepatan Motor Tuning)

  • Misc:
    • Epsilon: 0.00254 mm (jarak terdekat perpindahan spindle yang ditolelir. Sumbu X,Y maupun Z)
    • DDRF: biarkan kosong, kecuali jika CNC mampu mengganti bor otomatis
  • Z Axis:
    • Z High: 12 mm (Jarah terjauh/tertinggi bor ke PCB untuk istirahat)
    • Z Up: 2 mm (Jarak bor ke PCB saat pindah dari satu tempat ke tempat lain)
    • Z Down: -0.05 mm (kedalaman miling/guratan PCB, sesuaikan dengan ketebalan lapisan tembaga pada PCB)
    • Drill Depth: -2 mm (sesuaikan dengan tebal PCB + 0.5 mm untuk kalibrasi posisi mata bor saat  pengeboran)
    • Drill Dwell: 0.5 detik (Lamanya proses pengeboran)
  • Tool Change: (posisi spindle saat mengganti bor)
    • Position X: 0 mm
    • Position Y: 0 mm
    • Position Z: 21 mm (sesuaikan dengan panjang colet/dudukan mata bor)
  • GCOde Option, Plugins dan Other: Untuk sementara, biarkan default

Jika parameter sudah diisi semua, maka tekan tombol Accept and make my board. Jendela preview akan muncul.

Cek kondisi preview milling/guratan. Jika ada yang tidak tergurat. Ganti/geser letak jalur atau ganti jalu yang ukuranya lebih kecil. Ukuran jalur terkecil yang diperkenankan adalah 0.6mm (25 mil)

Modifikasi file GCode untuk proses autolevelling

Autoleveling adalah menentukan ketinggian/ketebalan PCB dengan bantuan probe pada mesin CNC pada port 15 menggunakan Software Autoleveling.

Buka software Autoleveler (software ini memerlukan java) lalu pilih mesin Mach3 (Sebelah tombol About). Klik tombol Browse for Gcode dan arahkan ke file hasil pengubahan ke GCode. File ditandai dengan akhiran .bot.etch.tap untuk layer bawah dan akhiran .top.etch.tap untuk layer atas.

Secara otomatis bagian Probe setting akan terisi. Jika ingin dimodifikasi:

  • Z Feed: 100 mm/menit (kecepatan probing, semakin kecil semakin presisi. Jangan melebihi Z feed Rate pada PCB-GCode)
  • Probe Depth: -0.1 mm (Jika PCB tidak berhasil di-probe, maka secara otomatis dianggab PCB berada di 0.1 mm dibawah mata bor)
  • Probe clearance: 2.5 mm (Mata bor akan berpindah antar titik probe dengan ketinggian 2 mm. Isikan sesuai rumus: Z UP pada PCB-GCode + Probe Depth pada autoleveler Misal: 3mm + (-0.5)mm = 2.5 mm )
  • Probe Spacing: 25 mm (Jarak antar probe. Karena ukuran PCB 100mm x 100mm maka diganti menjadi 20mm agar hasilnya: 100*100 / 25*25 = 16 kali probe saja)
  • Z Safe Heigh: 20 mm (Jarak probe terjauh ke atas untuk berhenti)

Setelah parameter diisikan, klik tombol  CreateLevelledGCode lalu disimpan. file siap dibuka di Mach3.

Modifikasi file GCode drill.tap agar ada waktu untuk mengganti mata bor

Buka file .bot.drill.tap dan ganti perintah: G01 Z0.0000  F254 menjadi M00 (ganti perintah pindah ke posisi Z=0 mm mjd perintah stop). Maksud penggantian kode yaitu agar saat pergantian bor (setelah perintah M06) maka mesin akan berhenti. Saat mesin berhenti, bor dapat diganti sesuai dengan ukuran yang ditunjukkan di GCode setelah tanda ; (titik koma) dalam satuan milimeter.

Nilai F254 mungkin berbeda, karena bergantung dari nilai Feed Rate yang diisikan di PCB Gcode

Pengoperasian Mesin:

Pasang PCB sesuai gambar berikut:


Pastikan PCB tidak menggelembung. Alasi PCB dengan papan yang rata, atau PCB yang sudah tidak terpakai.
Buka Mach3 lalu klik pada tombol SoftLimit hingga border hijau hilang. Ingat Mach3 harus dibuka dahulu sebelung mengaktifkan mesin CNC, agar CNC tidak bergerak sendiri / mengunci jika terjadi error pada port
komputer.

Aktifkan mesin CNC lalu tekan tombol Reset (biasanya berkedip jika belum ditekan) hingga border berwarna hijau.

Arahkan dahulu spindle/bor ke arah atas dengan tombol Page Up agar spindel tidak menabrak PCB. Geser CNC menggunakan tombol tanda panah kiri (<–) atau kanan (–>) untuk mengggerakkan
spindle, serta atur letak PCB agar tidak miring. Awas: YOOCNC memiliki arah X+  dan x- terbalik, maka
hati hati dalam menggerakkan spindle.

Taruh mata bor/bit tepat diatas koordinat titik nol yang dikehendaki sekitar 2 s.d 3 mm, jangan
terlalu dekat dengan PCB. Ada kalanya PCB tidak rata. Lalu gerakkan bor ke semua arah PCB. Jika terlalu mepet dengan PCB, gerakkan ke atas dengan tombol Page Up pada keyboard. Jika terlalu jauh dari PCB, gerakkan ke  arah bawah dengan tombol Page Down. Awas: Hati-hati saat menggerakkan  spindle ke bawah, jika bits/mata bor terkena PCB maka bisa patah, atau PCB berlubang!

Jika sudah siap, mata bor ditaruh di atas PCB dengan tepat pada titik nol yang diinginkan, maka tekan tombol REF ALL HOME pada Mach3. Putar spindle lalu lubangi sedikit untuk titik 0 dengan cara menekan tombol page down pada keyboard. Lubang nantinya dijadikan tanda untuk titik nol pada saat pengboran.

Cek setingan port pada menu tool, pastikan pada port 15 dan active low dicentang. Lihat kondisi probe pada Tab diagnostic. Pastikan saat probe dihubungkan kedua kutubnya, maka bagian Digitize akan berwarna Hijau.

Pasang kutub probe pada spindle, tapi jangan diaktifkan dahulu spindelnya. Pasang kutub yang lain pada PCB. Penting: Pastikan penjepit probe menjepit kuat agar tidak lepas. Kalau sampai lepas, maka bit akan patah, PCB berlubang dan bahkan dasar mesin CNC juga berlubang!

Load file GCode hasil Autoleveler. Lanjutkan dengan pindah spindle menyusuri PCB sesuai pada gambar toolPath, dan pastikan semua area toolpath terkover di PCB (Ukuran PCB tidak kurang) serta tidak menabrak penjepit PCB.

Kembalikan ke titik 0 dengan menekan tombol GOTO Z (Goto Zero). Klik Run dan biarkan CNC
bekerja sambil diamati! Wajib: Sambil diamati! Bila probe atau bits/mata bor menabarak
sesuatu, langsung ditekan tombol EMERGENCY STOP agar CNC tidak rusak lalu ulangi lagi langkah
dari awal.

Saat selesai probing, maka CNC akan berhenti. Ambil probe, jaga jangan sampai terhubung antar
probe dan aktifkan spindle dengan kecepatan maksimum. Saat sudah sampai ke kecepatan maksimum,
tekan Run di Mach3 lagi. (Sekali lagi, wajib: Sambil diamati! Bila probe atau bits/mata bor menabarak sesuatu, langsung tekan tombol EMERGENCY STOP agar CNC tidak rusak lalu ulangi lagi langkah dari awal)

Setelah selesai, biasakan untuk mengembalikan posisi spindle ke home, atau titik nol. Gunakan
fasilitas tombol Goto Z pada Mach3.

Proses pengeboran

Pindah spindle ke atas dengan tombol keyboard Page Up secukupnya, lalu ganti bor dengan ukuran terkecil. Setelah diganti, turunkan mata bor sedikit demi sedikit hingga kurang lebih 1mm jangan terlalu dekat dengan PCB. Lalu tekan REF ALL Home. Lalu gerakkan bor ke semua arah PCB.

Jika terlalu mepet dengan PCB, gerakkan ke atas dengan tombol Page UP. Catat perubahan Z lalu
kembali he home dengan tombol Goto Z lalu naikkan dengan tombol Page Up hingga nilai Z sesuai
pada catatan dan klik REF ALL Home.

Awas: Hati-hati saat menggerakkan spindle ke bawah, jika bits/mata bor terkena PCB maka bisa patah, atau PCB berlubang!

Usahakan jarak terjauh antar PCB dengan mata bor di seluruh permukaan PCM maksimal adalah 0.5 mm
(Sesuai dengan perhitungan Drill Depth pada PCB-GCode). Ulangi langkah pemindahan mata bor ke
seluruh PCB hingga tidah ada PCB yang terlalu mepet pada mata bor.

Jika semua OK maka kembali ke home dengan tekan GOTO Z.

jika home tidak pas pada lubang titik 0 yang tadi ditandai saat miling, maka paskan dengan
menekan tombol panah, namun jangan mengubah ketinggian mata bor. Jika sudah pas, maka tekan
REF ALL Home. Catatan: Jika ternyata spindle berubah ketinggian, atau terpencel tombol page up atau
page down, maka kembalikan ke titik 0 dengan Goto Z.

Tutupi PCB dengan kertas transparan (mika) agar debu pengeboran tidak tercecer! Buka file GCode drill.bot.tap dan kemudian Run (Klik cycle Start) dan biarkan CNC bekerja. (Wajib: Saat CNC bekerja, haris diamati! Bila bits/mata bor menabarak sesuatu, langsung tekan tombol EMERGENCY STOP agar CNC tidak rusak lalu ulangi lagi langkah dari awal)

Proses Penggantian mata bor

Saat GCode sampai pada kode M00, maka proses pengeboran berhenti. Matikan dahulu spindle lalu ganti mata bor sesuai ukuran yang ditunjukkan pada GCode. Jangan sampai posisi berubah dan CNC jangan dimatikan, cukup matikan putaran spindle saja.

AWAS: Mata bor mudah patah, jatuh dari atas meja saja sudah patah!