2016年1月8日 星期五

[Access VBA] Send Email from Access VBA

Private Sub Command0_Click()


Dim olApp As Object
Dim objMail As Object

On Error Resume Next 'Keep going if there is an error


Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open


If Err Then 'Outlook is not open
Set olApp = CreateObject("Outlook.Application") 'Create a new instance of Outlook
End If

'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)


With objMail

'Set body format to HTML
.BodyFormat = olFormatHTML

.To = "your email; your second email"
.Subject = "Subject"
.HTMLBody = "<HTML><H2>The body of this message will appear in HTML.</H2><BODY>Type the message text here. </BODY></HTML>"
'.Send     ' 直接寄出
.Display  ' 顯示outlook

End With


參考資料: http://msdn.microsoft.com/en-us/library/office/ff861332.aspx

[Access VBA] 如何滙出資料到Excel


Q1: 
 in  VBA code , 

  Dim appExcel As Excel.Application

 why ?? 在執行的時候會出現 "使用者自訂型態尚未定義"

Answer: 

    在工具->設定引用項目  ,選擇 Microsoft Excel 12.0 Object Library

2015年12月7日 星期一

GPIO Open Drain?






GPIO 表示此pin可設定為 output 或 input。

GPIO 設為output mode


若設為output 表示此pin有 source或sink 電流的能力 。表示若pin設成High,可以成為電流輸出的來源端(Source); 若pin設成Low,可以成為電流流入的汲端(sink)。

GPIO的邏輯方塊圖 (內部由兩顆電晶體來控制High或Low)


2015年12月3日 星期四

ARM Cortex MCU 開發環境建置


開發...最麻煩的就是把環境弄好, 才能開始研究,做更深入的研究



 以新唐Nuvton 的IC而言, 目前它支援的開發IDE有3種

  • Keil RealView MDK V4.12 or higher
  • CooCox CoIDE V1.0.0 or higher
  • IAR Embedded Workbench V5.xx

底下介紹的是使用ARM MDK環境建置的說明:
  1.  安裝Keil MDK (v5.xx) 的IDE工具 (這個基本上一直"下一步"就裝完了)
  2.  安裝NuLink Driver for MDK (Debug 及 線上燒錄) 或使用Jlink 燒錄  

ARM MDK 開發工具


ARM based MCU=ARM Cortex-M + Peripherals。

針對ARM Cortex-M 這種MCU的開發, ARM 原廠提供的是MDK ARM開發工具。



2015年11月25日 星期三

PCB Layout 入門教學(零) ---認識IC零件規格



IC元件主要分為DIP及SMD兩大類, DIP 插件的IC, SMD (Surface Mount Device) 表面黏著元件。



在SMD世界裡,常會聽到 0603, 0805, 1206 指的是什麼? 

指的其實是元件的Package尺寸, 尺寸講的是長(Length)x寬(Width)。使用的單位可以是inch或mm 。一般常講的SMD 的電阻、電容都是用inch來描述元件的尺寸大小。總共4位數表示, 2個位數一組。

0603:  0.06"x0.03", or 60x30 mils, or 1.6x0.8mm   (Note: 1mil=千分之一英寸)
0805:  0.08"x0.05", or 80x50 mils, or 2.0x1.25mm
1206:  0.12"x0.06", or 120x60 mils, or 3.2x1.6mm