使用树莓派做AVR芯片的下载器

  1. 安装avrdude
  2. 更改配置文件,查找gpio将对应的linuxgpio中相关注释的内容删除
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface
    #
    #To enable it set the configuration below to match the GPIO lines connected to the
    #relevant ISP header pins and uncomment the entry definition. In case you don't
    #have the required permissions to edit this system wide config file put the
    #entry in a separate <your name>.conf file and use it with -C+<your name>.conf
    #on the command line.
    #
    #To check if your avrdude build has support for the linuxgpio programmer compiled in,
    #use -c?type on the command line and look for linuxgpio in the list. If it's not available
    #you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude.
    #
    programmer
    id = "linuxgpio";
    desc = "Use the Linux sysfs interface to bitbang GPIO lines";
    type = "linuxgpio";
    reset = 16;
    sck = 24;
    mosi = 23;
    miso = 18;
    ;

note:avrdude配置文件中的IO编号对应的芯片上的管脚编号BCM#,而不是树莓派提供的排针接口的编号

  1. 使用avrdude下载程序时,选择下载器linuxgpio
  2. 在使用过程中,常会遇到Can't export GPIO 16, already exported/busy?: Device or resource busy的错误,原因尚未搞清楚,可以用如下指令恢复
    1
    sudo echo 16 > /sys/class/gpio/unexport

JavaScript学习笔记

JavaScript

  • 涉及到的函数

    • alert()
    • prompt()
    • confirm()
  • JavaScript 放置的位置
    JavaScript 代码可以放置到任何地方,但仍有通用的模式

    1
    2
    3
    4
    5
    6
    7
    8
    9
    <!DOCTYPE html>
    <html>
    <head>
    ... load JavaScript libraries here ...
    </head>
    <body>
    ... your JavaScript code typically goes at the end of body ...
    </body>
    </html>

继续阅读全文 »

HTML CSS 学习笔记

HTML 学习笔记

该笔记是对David Rossiter教授开设的 HTML、CSS和JavaScript 课程的学习记录。主要对其讲义进行翻译,记录。

初始html Getting to know html

  • 涉及到的html元素
    • 结构 <html> <head> <body>
    • <head>中: <meta> <author><style> <link> <script> <base>
    • <body>中: <h1> <p>
  • HTML的命令(commands)称为元素(elements)。元素通常由一个开始标签(tag)和一个结束标签组成。例如:<p>...</p>
  • HTML页面结构

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <!DOCTYPE html>
    <html>
    <head>
    ... header elements go here...
    ... 这里添加头元素 ...
    </head>
    <body>
    ... the main web page content goes here ...
    ... 正文内容 ...
    </body>
    </html>
  • 一个简单的网页

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <!DOCTYPE html>
    <html>
    <head>
    <title>A Simple Web Page</title>
    <meta name="athor" content="David Rossiter">
    </head>
    <body>
    <h1>My Web Page</h1>
    <p>This web page is so awesom!</p>
    </body>
    </html>

继续阅读全文 »