Quantcast
Channel: 懒得折腾
Viewing all 764 articles
Browse latest View live

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

$
0
0

雷锋网(公众号:雷锋网)按:本文作者为区块链信徒: 加密货币轻度炒家,区块链技术信徒,程序员。

9月4日下午,首次代币发行(ICO)融资被北京当局叫停,消息传出,虚拟货币价格应声大跌,众多代币投资者纷纷被套牢其中。在这一波疯狂“投资”背后,黑吃黑的逻辑如何?请看文章。

先给大家讲个故事:

我是村里大财主,发家全靠加密货币。今天我跟全村人说发财的机会又来了,这次我投资的X项目非常牛,应该能颠覆世界。你们一听,觉得人生能有几次这样的机会,恨不得跪下来求带着一起发财。我说这个项目不能用现金投,但是你可以去村里老王家买某个加密货币来投。你听了我忽悠,去老王那以30块钱一个的价格买加密货币来投我。我一共收到了一万个加密货币,然后又以差不多28、29的价格转手卖给了老王。

一个月后,国家说我非法集资,我表示要积极配合,一定退回原来村里人投给我的加密货币,这时市场恐慌,老王那里的加密货币只值一块了。于是我花1万块买了1万个加密货币退回去,然后跟村里人说咱们两清了啊,这次要不是国家,我肯定带大家实现财富自由,接着带着剩下的27、28万利润去城里潇洒去了。

是不是挺黑暗的?但现实比这个还黑暗,本文就将会以李笑来投资的所谓的 ICO 项目 EOS 详加介绍。

作者玩加密货币也算比较早吧,不过一直都是小打小闹,经历过最开始一波莱特币从3块多涨到了100多。然后在今年四月多的时候,又开始关注加密货币,后来李笑来在『学习学习再学习』公众号里发布文章提到了自己投资的 EOS,这时 EOS 项目算是开始进入了作者的视界,也开始了解了 ICO。

和大部分人一样,作者最开始也是幻想着一夜暴富,翻上个十几二十上百上万倍,恨不得卖房卖车赌一把实现财富自由,不过作为被股灾收割过的韭菜,作者还是及时恢复了理智,做了些调查。

EOS的真实面目

EOS 的幕后团队是 block.one,这是一家注册在香港的公司(当时查的情况),团队 CTO 是昵称为 Bytemaster(简称BM)的技术天才,投资人里有李笑来/硬币资本,还有一家香港公司的一些成员。说到李笑来,非常厉害的角色,他创建的硬币资本(INBlockchain)搭建了从 ICO 项目启动宣传到 ICO 项目代币销售分发的完整链条。

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

硬币资本投资的项目,台上站着的就是李笑来

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

李笑来未被 block.one 撇清关系下架前的网站截图(部分)

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

以李笑来为核心的 ICO 产业链条图( EOS 项目为例)

EOS的ICO链条

下面就以伪 ICO 项目 EOS 为例来分析一下整个 ICO 链条吧,假设你是新人。

1、ICO 项目筹备阶段

先要拜码头,找大V站台,有没有技术不重要,重要的是要让人以为你有技术,有大V撑腰,会拉 ICO 项目的代币。这个阶段需要和站台的大V商量好分赃比例或者给多少钱,如果是分成,还要介绍资源,比如可以收买哪些自媒体宣传自己,去哪个交易所上市交易等。EOS 筹备的比较精细,充分考虑了规避法律追责,在香港成立了 blockone 公司。

2、ICO 项目营销阶段

大V要出来站台了,或公开支持或隐晦地表示看好这个颠覆某个行业的 ICO 项目,投资人会拥有这个NB项目多少的权益,一切都是这么美好。各个小号在微博、微信群、QQ群里鼓吹互捧,ICO自媒体们适时地发表分析文章,煞有其事地评个级啥的。EOS 在国内站台主要就是其投资人硬币资本的李笑来和老猫了,很多 ICO 自媒体以及硬币资本/李笑来投资的 ICO 项目这时也纷纷出来摇旗呐喊。

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

3、ICO 正式实施阶段

ICO 项目正式开始筹资会上ico.info这样的ICO平台,或者直接在交易所的网站上进行ICO,比如云币网就进行了包括公信宝(GXB)在内的多期ICO。

ICO 的方式有很多种,有预设了限额不够就原路退回的,当然也有没有达成目标也不退的(比如李笑来的PressOne,虽然后来迫于压力开放了一次退币),还有像 EOS 这样持续近一年采用拍卖形式的 ICO。这里面的门道很多,比如 EOS 每天都会有一轮代币拍卖,blockone 在官网承诺了不会以任何形式去参与 EOS 的拍卖,但实际上,每天 EOS 拍卖最后十分钟总是会涌入大量买单,将 EOS 代币的价格维持在各交易所的 EOS 市价附近。天天如此,是不是很巧合?没有监管的情况下,在加密货币里开设这种『老鼠仓』 操纵价格就是这么简单。

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

信誉破产的承诺

4、ICO 代币上交易所交易阶段

一般来说,代币上交易所都要缴纳一定的份子钱,之前网传大概为一千万左右。EOS 由于其投资人为硬币资本的李笑来,其旗下有云币网这个交易所,可能省掉了这笔费用。上了交易所之后,由于没有监管,交易所、庄家、大户其实是可以肆意操纵代币价格的。而且交易所的手续费一般为百分之一(股票券商的手续费很多为万分之十乃至万分之四),韭菜们追涨杀跌用不了多少次,资产就被交易所和庄们瓜分完了。

在这一阶段,ICO 项目利益相关方们会释放各种所谓的利好消息来抬升代币价格出货,大多数韭菜还想着翻十倍百倍现在只翻了两三倍不会卖。EOS 则玩得更高级,除了消息刺激外,李笑来通过其投资的 ico.info 启动新的 ICO 项目(传销里面叫开新盘)来吸纳市场上流通的 EOS,以更进一步稳定 EOS 代币的价格(韭菜再多,EOS 一天出 200 万个代币也受不了啊),比如李笑来发起的 PressOne 吸收了近 3000 万 EOS,薛蛮子的 BEX 吸收了近 1000 万 EOS 等等。

由于没有监管,事实上投资者根本不知道卖掉这些代币的钱用去做什么了。EOS 更是直接宣称,出售 EOS 的收益全归 block.one 所有,投资人根本无权过问,更别提审计了。

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

就差说『SX,来给我送钱啊』了

现在随着国内监管政策的出台,block.one 发表声明,意图撇清与李笑来的关系,将自己伪装成一个国际 ICO 项目来逃避监管,继续进行 ICO,不安排清退工作,顶风作案,这又置国家法律、置那些卖房贷款 30 元买入 EOS 的投资人于何地?另外,ico.info 也立刻销毁了证据(谷歌快照有保存),这些行为的背后又在怕什么呢?

以上基本上就是一个 ICO 从诞生到上市交易的整个流程了,一个韭菜贸然进入,不及时抽身,结局只能是让人从头吃到尾,最后剩点渣或者连渣都不剩。

对于这一波“ICO”投资,广大读者怎么看?欢迎文末评论区交流。

李笑来的ICO财富自由之路:从头吃到尾,渣都不剩

雷锋网原创文章,未经授权禁止转载。详情见转载须知



ICO与区块链:剖析ICO的金融与技术原理

$
0
0

雷锋网(公众号:雷锋网)AI金融评论按:本文作者为中国信息通信研究院(工信部电信研究院)专家敖萌博士,雷锋网独家特约文章,雷锋网与信通院联合首发。未来,敖萌博士原创的区块链系列文章还将继续刊出,雷锋网与信通院相关平台同步更新,敬请关注!

ICO与区块链:剖析ICO的金融与技术原理

技术推动金融创新:ICO的来龙去脉

在讲ICO之前,我先讲这样一个故事。

有一个人开了一间赌场,每个赌徒要来赌场玩,必须先换一些筹码,才能参与赌场内的赌局。赌场内所有赌局都是实时利用筹码结算的。这间赌场服务特别好,赌具特别好,入场费收得也非常低,总之一切都特别好,于是越来越多的赌徒都慕名而来,跑到这间赌场来玩,赌局额度也越来越大。自然,这就需要更多的筹码来确保赌场的顺利运营。但是,这间赌场的筹码是用一种特殊的金属、特殊的工艺制造的,这些赌具只能用这种筹码玩。赌场一开始的时候造了一万个,以后再也造不出来了。怎么办?

ICO与区块链:剖析ICO的金融与技术原理

参与赌局的人越来越多,赌局额度越来越大,原本1个筹码1美元,同时100个人在玩,一次赢1美元,赌场运行得很顺利,除了在赌徒间流通的筹码外,赌场手里还有一些筹码,可以卖给刚进场的赌徒。现在来了1000个人,每次要赢100美元,依然只有1万个筹码。为了玩得尽兴,于是赌徒之间互相约定,我们1个筹码100美元,这样就能玩得尽兴了。新进场的赌徒从老赌徒手里高价买回了筹码。老赌徒大赚了一笔,新赌徒玩的尽兴,赌场呢?手里剩的筹码也可以100美元的价格卖出去了。

由于赌场运营得越来越好,来的赌徒越来越多,赌局越来越大,筹码的价格就一路上涨。对于赌场而言,由于一开始有大量的筹码以1美元的价格卖给了老赌徒,如果按照100美元的价格承兑,赌场就亏大了。于是,赌场就宣布,找我承兑筹码可以,但是只能按照1美元的价格。但是赌场在卖出筹码的时候,依然按照市场价100美元出售。这也成为赌场盈利的一种手段。于是大家都不会把赢来的筹码拿去找赌场退钱,而是留在手里等着卖给新的赌徒。

ICO与区块链:剖析ICO的金融与技术原理

故事讲完了,我们再来复习一点经济学上的基础知识。随着生产力越来越高,市场越来越大,市场上流通的商品(总价值)越来越多,如果货币的流通速度不变,理论上就需要更多的货币。从这个刚才的故事里,可以非常容易地看出,由于赌场固定了筹码的总额,加上很多人持币等待升值造成筹码流通速度变化不大,于是筹码价格只能上涨。

讲了这么半天,到底什么是ICO还没说呢。别急,再讲一个故事,你就明白了。

又有一个人,看到了赌场的生意这么好,很多人赚得盆满钵满的,于是他也想开一间赌场。可是他没有足够的本钱,怎么办呢?于是他公开宣布:“我要开一间赌场,赌场服务非常好,赌局非常好,手续费非常低。我的赌场只有10000个筹码,以后绝不增加。现在我把筹码先造出来了,其中5000个筹码任何人都可以来买。买完了以后,我就用卖掉这5000个筹码的钱作为本钱开赌场。等赌场开业了,你们可以把手里的筹码卖给赌徒,或者自己来赌都行。”

由于开始赌场还没开业,所以出售的筹码价格也是很低的,0.5美元1个。等赌场开业了,至少1美元1个,甚至更高。由于很多人都看好这个生意,于是5000个筹码很快就卖光了。这个人筹集到了2500美元,造了一些赌具,租了间房子,赌场就开始营业了。由于他的服务真的很好,很快又聚集了大量的赌徒,于是筹码的价格一路飞涨,很快就到了100美元。在赌场开业前以0.5美元的价格买了筹码的人,筹码增值了200倍。

这个故事讲的就是ICO的金融原理。

怎样才是优秀的ICO?

ICO英文全称是Initial Coin Offering,翻译成中文是“初始货币供应”。ICO的基本原理就是:公司创造了一种商业模式,在这种商业模式里,大家只能使用公司自己发行的“代币”(不理解代币的,想想腾讯的Q币就明白了)进行交易。公司事先宣布,这种代币总额是固定的,或者增发的方式是固定的,也就是说,任何人都不能更改代币增发的规则(总额固定也是一种增发规则哦)。

如果大家认为我们的商业模式非常有前途,我们的代币就会增值。现在公司拿出一定比例的代币进行发售,用筹得的经费作为本钱来运营这种商业模式。这种依靠出售日后商业模式中的某种公司产品(如果代币可以视为公司产品的话)的方式来筹集资金的金融行为,就被称为ICO。

ICO与区块链:剖析ICO的金融与技术原理

注意,ICO具有以下几个特点:

  • 1、所发行的代币必须是在未来的商业模式中有使用价值,并且不可替代。

  • 2、ICO的商业模式中,代币的发行方式必须事先固定规则,并且不可更改。

  • 3、ICO虽然是一种商业融资的方式,但是ICO模式并不出让股权或者负债,也就是说,运营该商业的公司,未来仍可以继续出让股权或者举债。

讲了这么多,ICO看上去就是一种金融创新啊,ICO和区块链有啥关系?为啥要放到区块链讨论班来讲呢?

ICO与区块链的关系

上面谈到的ICO的特点中,前两点,要求该公司或者运营团队必须让大家相信,他们的商业模式中代币的作用和发行方式不会变化。也就是说,运营团队必须有足够的信用,才能让大家相信他们未来不会更改规则。

怎样做才能有信用?我们前一篇文章讲过,“区块链的价值在于,没有任何一个中心能够控制这个系统,数据一旦产生便不可更改,这产生了强大的信任。”只要将整个商业模式设计在一套区块链系统上,将商业模式的规则和代币的发行方式利用区块链固化下来,由多个不同主体运营的节点甚至是利用公有链的方式来运营区块链系统,就能够获得强大的信用。换句话说,大家相信的是区块链,而不是运营团队。现在,你是不是知道ICO和区块链的关系了?

除了上面所说的最重要的一点外,还有一点也和区块链有很深的关系,那就是目前司法上尚未对ICO有明确的界定,各国的金融政策也没有对ICO进行明确的界定。因此,为了规避潜在的法律风险,同时也为了让运营团队无法随意更改用户购买初始代币的额度,目前ICO往往都是募集比特币和以太币这两种认知度比较高的数字货币。用户给运营团队的钱包地址发送的货币金额都会被全网记录下来,没人能够更改。从这方面看,ICO也和区块链关系密切。

雷锋网特约稿件,未经授权禁止转载。详情见转载须知


献给写作者的 Markdown 新手指南

$
0
0
96
作者 简书 
2013.04.22 22:02* 字数 1478 阅读 556405评论 501赞赏 20

「简书」作为一款「写作软件」在诞生之初就支持了 Markdown,Markdown 是一种「电子邮件」风格的「标记语言」,我们强烈推荐所有写作者学习和掌握该语言。为什么?可以参考:

在此,我们总结 Markdown 的优点如下:

  • 纯文本,所以兼容性极强,可以用所有文本编辑器打开。
  • 让你专注于文字而不是排版。
  • 格式转换方便,Markdown 的文本你可以轻松转换为 html、电子书等。
  • Markdown 的标记语法有极好的可读性。

当然,我们既然如此推崇 Markdown ,也必定会教会你使用 Markdown ,这也是本文的目的所在。不过,虽然 Markdown 的语法已经足够简单,但是现有的 Markdown 语法说明更多的是写给 web 从业者看的,对于很多写作者来说,学习起来效率很低,现在,我们特地为写作者量身定做本指南,从写作者的实际需求出发,介绍写作者真正实用的常用格式,深入浅出、图文并茂地让您迅速掌握 Markdown 语法。

为了使您更好地学习,我们建议您登录「简书」,将您的编辑器切换至 Markdown 编辑器,新建一篇空白笔记,然后点击右上角的预览模式:

此时,您的界面应当如下图所示,左侧为编辑区域,右侧为预览区域,您在左侧输入 Markdown 语法的文本,右侧会立即帮您呈现最终结果,好了,让我们开始学习吧~

标题

这是最为常用的格式,在平时常用的的文本编辑器中大多是这样实现的:输入文本、选中文本、设置标题格式。

而在 Markdown 中,你只需要在文本前面加上 # 即可,同理、你还可以增加二级标题、三级标题、四级标题、五级标题和六级标题,总共六级,只需要增加 # 即可,标题字号相应降低。例如:

# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题

注:# 和「一级标题」之间建议保留一个字符的空格,这是最标准的 Markdown 写法。

你可以你的编辑器中尝试输入这六级标题,可以参考下方的截图:

一级标题至六级标题

列表

列表格式也很常用,在 Markdown 中,你只需要在文字前面加上 - 就可以了,例如:

- 文本1
- 文本2
- 文本3

如果你希望有序列表,
也可以在文字前面加上 1. 2. 3. 就可以了,例如:

1. 文本1
2. 文本2
3. 文本3

注:-1.和文本之间要保留一个字符的空格。

列表案例截图如下:

链接和图片

在 Markdown 中,插入链接不需要其他按钮,你只需要使用 [显示文本](链接地址) 这样的语法即可,例如:

[简书](http://www.jianshu.com)

在 Markdown 中,插入图片不需要其他按钮,你只需要使用 ![](图片链接地址) 这样的语法即可,例如:

![](http://upload-images.jianshu.io/upload_images/259-0ad0d0bfc1c608b6.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

注:插入图片的语法和链接的语法很像,只是前面多了一个 

插入链接和图片的案例截图:

引用

在我们写作的时候经常需要引用他人的文字,这个时候引用这个格式就很有必要了,在 Markdown 中,你只需要在你希望引用的文字前面加上 > 就好了,例如:

> 一盏灯, 一片昏黄; 一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

注:> 和文本之间要保留一个字符的空格。

最终显示的就是:

一盏灯, 一片昏黄; 一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

引用的案例截图:

粗体和斜体

Markdown 的粗体和斜体也非常简单,用两个 * 包含一段文本就是粗体的语法,用一个 * 包含一段文本就是斜体的语法。例如:

 *一盏灯*, 一片昏黄;**一简书**, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

最终显示的就是下文,其中「一盏灯」是斜体,「一简书」是粗体:

一盏灯, 一片昏黄;一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

粗体和斜体的案例截图:

代码引用

需要引用代码时,如果引用的语句只有一段,不分行,可以用 ` 将语句包起来。
如果引用的语句为多行,可以将“`置于这段代码的首行和末行。
代码引用的案例截图:

表格

相关代码:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

显示效果:

Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1

相关代码:

dog | bird | cat
----|------|----
foo | foo  | foo
bar | bar  | bar
baz | baz  | baz

显示效果:

dog bird cat
foo foo foo
bar bar bar
baz baz baz

显示链接中带括号的图片

代码如下:

![][1]
[1]: http://latex.codecogs.com/gif.latex?\prod%20\(n_{i}\)+1

结语

以上几种格式是比较常用的格式,所以我们针对这些语法做了比较详细的说明。除这些之外,Markdown 还有其他语法,如想了解和学习更多,可以参考这篇『Markdown 语法说明』

强烈建议您现在就立马用 Markdown 写一篇文章吧,体会一下 Markdown 的优雅之处!

最后,希望我们的指南可以帮助到您,也希望「简书」能够成为您书写 Markdown 的最佳选择。

 简书帮助中心

您的鼓励是我们前进的动力!

赞赏支持

等20人


Everyday Parenting: The ABCs of Child Rearing

$
0
0

Common Challenging Behaviors

As mentioned before, this course will teach you techniques to change behavior – reduce challenging behaviors and develop positive behaviors. The list below covers routine behaviors treated at the Yale Parenting Center. Does your child exhibit the following behaviors? Keep a behavior you would like to change in mind as you go through the lessons.

  • Not complying with parental requests
  • Having a bad attitude
  • Speaking offensively or harshly
  • Breaking things
  • Having catastrophic tantrums
  • Showing disrespect
  • Being careless in playing with siblings
  • Stealing
  • Arguing
  • Lying
  • Hitting peers, parents, teachers, or principals
  • Confronting others
  • Bullying
  • Finicky eating
  • Playing disruptively with peers
  • Not sharing
  • Not engaging in self-care (bathing, brushing teeth, getting dressed)
  • Not going to bed on time
  • Breaking curfew
  • Not letting parents know where you are
  • Not taking medicine
  • Not socializing with other children
1.Special Praise
0:00

I want to provide a disclaimer or explanation as to why you are starting the course off with praise. Well, praise is a consequence and might come later. I put praise out of order for three reasons. First, it shows a common misconception as you will see very soon. Second, it is easy to practice and start using in the home. And third, because you’ll begin to see a difference in your child after a few days, only if you use this praise properly. I also refer to praise in many of the lessons, because it is so helpful for locking in behaviors. We are building enduring habits, and praise can really help. While I advise combining techniques from each a b c section for a strong behavior change program. Start with special praise, and practice for several days to get the feel of how to apply new techniques, and to use something familiar, but in a very different way.

0:00

We’ve been talking about various techniques to change child behavior. The techniques are a package and they have to be combined. We are breaking them down into individual techniques. In this video, we will talk about praise, that is praising one’s child. What is praise? Well, praise is very familiar. It refers to expressing approval in some way. We know this very well. It’s illustrated in everyday life as you parent by saying things such as, great, well done. This positive feedback is the praise we’re familiar with. And the effects? Well, we know those too. Praise makes us feel better. We smile. We’re pleased to hear it. And we’re just happier when there’s more praise in our life. You’re a parent, so you’re probably providing praise to your child. What could we possibly say in this video that would be new? Actually, quite a lot. And I think you’ll be pleasantly surprised. For today’s purposes, consider two kinds of praise. The first kind might be called routine normal or praise in everyday life. This the one you are doing, this is the one familiar to you. Children love it. It’ll help your relationship. Continue to do that. But there is a second type of praise, and that’s what we’re focusing on now. And this praise is really useful when you want to change some behavior. When you want to develop some behavior, getting your child to do homework, be a better listener, or have your child do something this strategic, this better kind of praise will get that behavior. And same thing we’ll use it later to get rid of some behaviors as well. This praise has three special features. The first of these, we’ll talk about with young children. The first of these is the praise should be very enthusiastic or effusion. It would look like this, “That’s great!” Had some hand gestures there, some facial expression, and the tone of voice was really up. Second component, state exactly what was being praised. “Great! You’ve picked up the toys just like I asked.” The third component is something nonverbal. It could be a touch on the shoulder, high fives, rubbing the child’s hair, a hug, kiss, whatever you do that’s comfortable, so nonverbal is the third part. And there’s research on this to show that each of these components is essential to make this special praise effective to change behavior. Consider an example, you’d like your child to set the table or pick up toys. You go over the child and say, “That’s great Mildred! You picked up your toys.” Now you go touch. Had the three ingredients. “Great Mildred! You picked up your toys. I go touch.”. Let us review one more time because this is such a critical tool in your toolkit. I have mentioned that special praise has three main ingredients, but the first step comes way before you praise the behavior. And that is to select the behavior you’d like to develop. In our example, we selected picking up and putting away toys. Keep a lookout for when the child does that specific behavior, so you can praise the behavior using the three special components. Praise effusively by smiling and using an enthusiastic tone. “That was great!” State the specific behavior when you acknowledge your child, “That was great! You put the toys away just like I asked.” Then add a gentle touch. Be close to the child as you’re giving praise and give some nonverbal affection such as a hug or patting your child on the shoulder in some way. When you try this at home, focus on one or two behaviors at first so you can practice giving praise frequently and consistently. How to make praise effective. Well, there are a couple of things. One of them is, it should be right after the behavior. For example, you would never say at dinner, “Raul, that was great the way you got ready for school this morning.” No, no, no. That’s too distant. It won’t do anything. We need the praise to be right next to getting ready for school. It has to be immediately after behavior. Also, we want the praise for small increments in behavior. You may want the full hour of homework each day, and we’ll talk about ways to get that full hour, but in the beginning, you want to praise small increments. And of course, you want to praise making sure that the behavior is done. Now there are some fascinating cautions in administering praise that are worth mentioning. What is said really makes a difference. Among the things to be alert to, avoid vacuous praise. Don’t just fire out there, “Great. Wonderful. You’re doing a good job.” That’s the normal phrase. It’s fine. It’s not a way to change behavior, so keep the differences quite clear. Secondly, do not praise the person. It would not be good to say to your child, “Dave, you’re really a good boy because you did these behaviors.” No, no. That can actually make the child feel bad, so don’t connect being a good boy. Also, do not convey that your love or liking depends on the behavior, “Mommy and Daddy really love you when you do X.” No, no, no, no, don’t do that. “Mommy and Daddy really love you no matter what you do.”. And then finally on this one, do not focus on yourself. “You make Mommy and Daddy happy when you do this.” No, no, no, no, no. “Mommy and Daddy are happy no matter what you do and you’re not the basis for our happiness that way.” And perhaps the most important lesson is what’s typical in parenting. We all do this. It’s called caboosing. Think for a moment of a train with many cars and the last car is called the caboose. In praise, the caboose is adding on something that undermines everything. You might have this perfect praise, “Great! You picked up your toys the way I asked. Nicely done.” You pat. Now the caboose, “Why can’t you always be like that? How come you can’t do it like your sister always does? Why do I have to nag you every time to get that behavior?” Those cabooses undermine and take away the effects of praise. What is so special that makes this praise work? What’s the magic behind the praise? Actually none. The key to the entire approach of all that we’re talking about is having the child practice the behaviors you want. We are building habits. We need the repetition of the behavior. And what praise does, it fits into that by increasing the likelihood that the child will do the behavior again, we have more practice. Or a really good way to think about this is to consider this like developing a skill, like playing a musical instrument. In a musical instrument, we want you to practice the notes, maybe little songs, and that repeated practice. What do we know about repeated practice? It actually changes the brain. And we want that practice because in the praise or the musical instrument if we get the behavior to occur in this repeated practice, we lock in the behavior, we can forget about the special praise. Now, some important questions and concerns often emerge in talking about praise. One of them is, will I need to praise the child forever to get him to do things? Is it a case that I have to praise my daughter to get dressed for the prom, we’ll have to continue this until she gets to the prom? Not at all. This is a very short time temporary program to make permanent changes. You get the behavior and then we stop. Will I spoil the child and make him expect praise from me for everything? Not at all. This does not work like that. You praise the behavior, you get repeated practice, you build in, you drop the program, you’re back to where you were before. Question. Why do I even need to do this at all, especially since my other child is so easygoing and cooperative and angelic? All we know to answer that is that people vary greatly, different temperaments, different personality. We even know that identical twins are actually very different. We don’t know how your child needs this or why your child needs this, but we do know that with the techniques we are talking about we can readily make these changes, even though we don’t know why the two children are different. Quick review. Three ingredients effusiveness, specific statements and something nonverbal. Will praise change the child and get the behaviors you want? Not by itself. It’s a critical ingredient. We are going to build a house and changing the behaviors you want in your child, and praise is a critical tool but you would never build a house with one tool. Praise is a good tool. We’re going to have other tools in later videos. .

0:00

We’ve been talking about various techniques to change child behavior. The techniques are a package and they have to be combined. We are breaking them down into individual techniques. In this video, we will talk about praise, that is praising one’s child. What is praise? Well, praise is very familiar. It refers to expressing approval in some way. We know this very well. It’s illustrated in everyday life as you parent by saying things such as, great, well done. This positive feedback is the praise we’re familiar with. And the effects? Well, we know those too. Praise makes us feel better. We smile. We’re pleased to hear it. And we’re just happier when there’s more praise in our life. You’re a parent, so you’re probably providing praise to your child. What could we possibly say in this video that would be new? Actually, quite a lot. And I think you’ll be pleasantly surprised. For today’s purposes, consider two kinds of praise. The first kind might be called routine normal or praise in everyday life. This the one you are doing, this is the one familiar to you. Children love it. It’ll help your relationship. Continue to do that. But there is a second type of praise, and that’s what we’re focusing on now. And this praise is really useful when you want to change some behavior. When you want to develop some behavior, getting your child to do homework, be a better listener, or have your child do something this strategic, this better kind of praise will get that behavior. And same thing we’ll use it later to get rid of some behaviors as well. This praise has three special features. The first of these, we’ll talk about with young children. The first of these is the praise should be very enthusiastic or effusion. It would look like this, “That’s great!” Had some hand gestures there, some facial expression, and the tone of voice was really up. Second component, state exactly what was being praised. “Great! You’ve picked up the toys just like I asked.” The third component is something nonverbal. It could be a touch on the shoulder, high fives, rubbing the child’s hair, a hug, kiss, whatever you do that’s comfortable, so nonverbal is the third part. And there’s research on this to show that each of these components is essential to make this special praise effective to change behavior. Consider an example, you’d like your child to set the table or pick up toys. You go over the child and say, “That’s great Mildred! You picked up your toys.” Now you go touch. Had the three ingredients. “Great Mildred! You picked up your toys. I go touch.”. Let us review one more time because this is such a critical tool in your toolkit. I have mentioned that special praise has three main ingredients, but the first step comes way before you praise the behavior. And that is to select the behavior you’d like to develop. In our example, we selected picking up and putting away toys. Keep a lookout for when the child does that specific behavior, so you can praise the behavior using the three special components. Praise effusively by smiling and using an enthusiastic tone. “That was great!” State the specific behavior when you acknowledge your child, “That was great! You put the toys away just like I asked.” Then add a gentle touch. Be close to the child as you’re giving praise and give some nonverbal affection such as a hug or patting your child on the shoulder in some way. When you try this at home, focus on one or two behaviors at first so you can practice giving praise frequently and consistently. How to make praise effective. Well, there are a couple of things. One of them is, it should be right after the behavior. For example, you would never say at dinner, “Raul, that was great the way you got ready for school this morning.” No, no, no. That’s too distant. It won’t do anything. We need the praise to be right next to getting ready for school. It has to be immediately after behavior. Also, we want the praise for small increments in behavior. You may want the full hour of homework each day, and we’ll talk about ways to get that full hour, but in the beginning, you want to praise small increments. And of course, you want to praise making sure that the behavior is done. Now there are some fascinating cautions in administering praise that are worth mentioning. What is said really makes a difference. Among the things to be alert to, avoid vacuous praise. Don’t just fire out there, “Great. Wonderful. You’re doing a good job.” That’s the normal phrase. It’s fine. It’s not a way to change behavior, so keep the differences quite clear. Secondly, do not praise the person. It would not be good to say to your child, “Dave, you’re really a good boy because you did these behaviors.” No, no. That can actually make the child feel bad, so don’t connect being a good boy. Also, do not convey that your love or liking depends on the behavior, “Mommy and Daddy really love you when you do X.” No, no, no, no, don’t do that. “Mommy and Daddy really love you no matter what you do.”. And then finally on this one, do not focus on yourself. “You make Mommy and Daddy happy when you do this.” No, no, no, no, no. “Mommy and Daddy are happy no matter what you do and you’re not the basis for our happiness that way.” And perhaps the most important lesson is what’s typical in parenting. We all do this. It’s called caboosing. Think for a moment of a train with many cars and the last car is called the caboose. In praise, the caboose is adding on something that undermines everything. You might have this perfect praise, “Great! You picked up your toys the way I asked. Nicely done.” You pat. Now the caboose, “Why can’t you always be like that? How come you can’t do it like your sister always does? Why do I have to nag you every time to get that behavior?” Those cabooses undermine and take away the effects of praise. What is so special that makes this praise work? What’s the magic behind the praise? Actually none. The key to the entire approach of all that we’re talking about is having the child practice the behaviors you want. We are building habits. We need the repetition of the behavior. And what praise does, it fits into that by increasing the likelihood that the child will do the behavior again, we have more practice. Or a really good way to think about this is to consider this like developing a skill, like playing a musical instrument. In a musical instrument, we want you to practice the notes, maybe little songs, and that repeated practice. What do we know about repeated practice? It actually changes the brain. And we want that practice because in the praise or the musical instrument if we get the behavior to occur in this repeated practice, we lock in the behavior, we can forget about the special praise. Now, some important questions and concerns often emerge in talking about praise. One of them is, will I need to praise the child forever to get him to do things? Is it a case that I have to praise my daughter to get dressed for the prom, we’ll have to continue this until she gets to the prom? Not at all. This is a very short time temporary program to make permanent changes. You get the behavior and then we stop. Will I spoil the child and make him expect praise from me for everything? Not at all. This does not work like that. You praise the behavior, you get repeated practice, you build in, you drop the program, you’re back to where you were before. Question. Why do I even need to do this at all, especially since my other child is so easygoing and cooperative and angelic? All we know to answer that is that people vary greatly, different temperaments, different personality. We even know that identical twins are actually very different. We don’t know how your child needs this or why your child needs this, but we do know that with the techniques we are talking about we can readily make these changes, even though we don’t know why the two children are different. Quick review. Three ingredients effusiveness, specific statements and something nonverbal. Will praise change the child and get the behaviors you want? Not by itself. It’s a critical ingredient. We are going to build a house and changing the behaviors you want in your child, and praise is a critical tool but you would never build a house with one tool. Praise is a good tool. We’re going to have other tools in later videos.

2.Antecendents
15:16

Remember, for all the videos, if your current child rearing practices are working the way you like, and you’re getting all the behaviors you want from your child. There’s no need to use special techniques. You can keep the behavior change tools we have discussed in the toolbox. All of the videos are about situations in which you would like to be more effective in changing particular child behaviors. When you want help to instill a particular behavior, you can pull one of these tools from your behavior change toolkit. These tools are different ways of applying antecedents, crafting the behaviors, and providing consequences. The ABCs, for example, saying please or adding a playful challenge might not be intuitive, but these prompts and positive setting events can be extremely powerful in initiating the desired behavior. Finally, parents often ask, how long do I have to keep giving these special prompts? Of course, at some point we want our children to do the behaviors without having to be there or give any prompts or reminders. If you prompt the behaviors to get it going and praise the behavior when it occurs, you will eventually establish the positive habit. There’s no way to say exactly how long you’ll have to use these prompts and the consequences for any given behavior. The key is how often you can praise the behavior. More practice locks in the behavior. If you see the behavior when the prompt is given, be sure to praise that. If you see the behavior when the prompt wasn’t given really praise that. I did not even ask you to do that, and you started your homework right away. That is great.

0:00

Here is an exercise to practice the use of antecedents in an effective way. When no one is around or when you are super comfortable, go to a place where you can look into a mirror, a bathroom mirror would be perfect. Now you are all by yourself, no child around. Now, practice making a request as you look at yourself in the mirror. This prompt could be something you normally might ask your child, maybe say, “Come down for breakfast.” Now, say this request in three ways while you look into the mirror. Remember, how you say something greatly influences the likelihood that your child will comply, which is why you are practicing. First, give the request in your usual way. Just say what you normally say, “Come down for breakfast.” OK. Now, do this in the second way with negative setting events, that is say it again with a frown. Make it sound like an order with your tone of voice, maybe add, “You have to do this,” or, “you should do this.” Maybe point a finger. In short, say it, “You have to come down for breakfast now.” We want you to act here. This could be the start of your acting career. Really go for it, make the request a little harsh by your look, your tone, and your gesture. Of course, we do not want you to develop this habit, but it will be very useful for you to see what prompts look like with negative setting events. Remember, these events decrease the likelihood that you will get the behavior you want in your child. Finally, practice the third way to say the prompt. State the request again but with positive setting events. Say the same thing but this time mix in a very gentle voice. Be your usual sweet self but slightly more exaggerated at a very calm tone. Smile a bit and put please right in front of the request, “Please come downstairs with me for breakfast.” OK. That was clearly the best of the three. Now, one more time say it again with positive setting events, but even do a better job. How would your favorite actor or actress do that. Say it this one more time calmer. Use the word please, smile and maybe add choice. You might see this as a silly exercise, but the use of positive antecedents does not come naturally to many people. And when it does, it can still be made much more effective as a tool to change child behavior. In my work, we actually bring parents into the room and practice giving antecedents. We go back and forth several times because practice is so important. We use antecedents to help parents by prompting them to add this or that and to make their voice just a little less harsh. And of course, we praise and provide feedback. For both children and parents, a key to change is practice. You will see this theme throughout the course. Now that you practice by yourself, practice in your home tomorrow when you want your child to get ready for school or to put on clothes or to put something away, to play nicely with siblings whatever. Whatever the typical requests are that you make be sure to try our different antecedents, like being calm, being close, smiling, saying please, offering choice, and giving a playful challenge. See what works. Remember, praise the child’s behavior after the antecedent gets that behavior. Praise is needed to lock that behavior in. Feel free to share your experience practicing in the mirror, with your fellow learners in the discussion threads. You might even be able to find an acting partner. Good luck. There are more tools to learn in upcoming videos.

Downloads

3.Behaviors
0:00

I have mentioned that the approach we are using has three main parts and they all work together to develop behavior. One part is called antecedents and refers to what we can do before behavior to make it occur. Another part is the behavior itself and what one does to get exactly the behavior you wish. The third part is the consequences or what we do after the behavior is completed. These are conveniently called A antecedents, B behaviors, and C consequences and easily remembered as the ABCs. In this video, we are taking up the behavior, the B part. And the guiding question of the tool we are discussing is, how can we get the behavior of the child that we would like to see. For example, you may want your child to be nice to his sister, or to eat vegetables once in a while, or to listen to you and actually do what you ask. But these never seem to occur or, at least, do not occur as often as you would like. If you find yourself nagging your child about something, this is a good sign that the behavior you want is not occurring enough. So how does one get behavior? Well, there are two excellent procedures. One of them is called shaping and that is the topic of this video. The other is called simulation and is the topic of a separate video. So what is shaping? Shaping consists of rewarding small steps that approximate or begin to resemble the final behavior you wish. So, if you want your child to do an hour of homework, we can usually get that by shaping. But it means we build the time gradually, maybe 10 minutes of homework at first. Then, when that is consistent, perhaps four out of five days, we can move on to a longer period. So shaping is a systematic way to start out small and reward more and more time with the behavior like in the example of doing homework. Now, if you’ve ever played a musical instrument, you will be able to see shaping at work. We want someone to play songs or other pieces of music but we do not start there. We start with learning how to play notes on the instrument, then some small units like scales, and so on. Songs are the goal but we usually do not start there. Or if we do start with songs, these are extremely simple in the beginning. In everyday life we do not use shaping automatically. There are two exceptions, when a toddler is starting to talk and mumble some word that begins with M, mmm, mom G. The parent may show great praise and say, Sarah just said mommy. Sarah didn’t say mommy but Sarah approximated mommy with the M and we praise instances of that as it gets closer and closer to say mommy. The same kind of shaping occurs when a toddler starts to walk. The child stands up, moves forward one step, and falls. We say, look Matt is walking. But Matt’s not walking. He’s just starting out. So you smile. You show great praise. And these initial steps aren’t quite walking but they develop into behavior that is walking. Now, these are okay examples. But they’re not that great. Because talking and walking have their own rewards and they’ll develop whether we praise them or not. For changing other behaviors, we may have more difficulty. Many parents might just nag the child and complain that she does not do her homework. Nagging frustrates everyone and does not change behavior. You want the child to clear all the dishes from the dinner table. You ask, that doesn’t work. You nag, that doesn’t help. And maybe you shout and that helps but you got it just once. Shaping can help and replace all of those less effective ways of getting the behavior. First, gently instruct rather than tell your child to clear his plate and put that plate in the sink. At the beginning of shaping, we start small. Just clear your plate. Praise that effusively. Do this for a couple of days. And then ask him to clear one or two more items from the table and continue this. Now, if you look at the video and at the scenes, you’ll see we can add a challenge to this. And say, something like that will really help the shaping. You could say, I bet you can’t clear your plate and mine. The tone of voice, the playful style will really help here. If the child would not even do that first step, that’s not a problem. You go to your child and you say, here let me help you, let’s do this together. Do that and be helpful, not angry. In a day or two, the child will do it by himself without you. But just to start shaping, it is fine to help if needed. Now, my example, is getting the child to clear dishes from the table. In the big scheme of how our children are developing, we don’t care very much about table setting or clearing. But you probably do care about the child listening to you and not defying what you ask. And working on a task such as table setting can help that. Because when you develop listening to you or being compliant in one place, it carries over to other places. So, here’s another example where we focus on being a good listener more directly. You feel your child doesn’t listen to you and do what you ask and are frustrated. Shaping can really help. Praise your child for being a good listener for the easy requests. Maybe ask your child to come over to dinner, or to come over for a hug, or to come over and do something fun. Anything that has no tension or struggle associated with it. Then give the special praise we’ve talked about. Great, you came over when I asked. And now, touch the child affectionately. This will increase the likelihood of listening to you at other times. Repeated practice is always the key. So do this for a while. Maybe a week or so. Praise the child for being a good listener for these easy requests. Then extend the praise to instances that’d be more difficult. Gradually, your child will be much more compliant for those more difficult instances. This will spread to other situations where you have not used the praise. So shaping can be used to get more of some behavior. You want more clothing picked up from the floor? Start with a few. Shaping is good for more time in doing some behavior, working on homework, or practicing a musical instrument. Start with a few minutes and build up. And shaping is good for less time in doing behaviors. Less time in getting ready for bed, less time in getting ready for school in the morning. Start out with a lot of time and cut it back through shaping. So the key ingredients of shaping are five separate ingredients. One, specify the behavior you would like. This is the final or goal behavior. Two, specify a small step, just an initial portion. Three, choose the consequence you will use. I recommend praise. Some parents like points. Now, praise instances of those small occurrences whenever you see them. And finally, five, when these instances occur consistently, maybe after a few days, make the requirement slightly more stringent but just a little bit. So, here is a practice exercise in case you want to try this at home. And we can use the five ingredients. First, what is the behavior that will be your goal. Write this down to make it very clear and concrete. You might say, I would like my child to eat a small portion of vegetables at dinner or I would like my child not to have tantrums at the grocery store. Second, now I select a very small version of that, a very beginning an early step toward that goal and write that down too. For the vegetables, it might be just putting a spoon with vegetables to his lips and actually not eating them. Believe it or not, that can lead to eating the full portion of vegetables. For getting dressed by himself? Maybe just putting on one piece of clothing by himself. Three, what will be the consequence? Now I suggest the special praise. But some parents want to use points or a privilege. Whatever the reward, it should be something immediate. Now, a separate video on praise mentioned that praise is really effective when it is very enthusiastic, it specifies what’s being praised, and is followed by an affectionate touch. The fourth step, now praise that small step whenever you see it. And if you did not see that small step, make the step even smaller or help the child do the first step. And finally, after some consistency, step five. Add a little bit more to move toward the final goal. Why do I need to do the shaping business at all? My child knows how to do the behavior. Well, I’ve mentioned this in other videos that knowing has very little relation to doing. This is a huge source of frustration for all of us. Our children may know what to do but still do not do the behavior. In psychology, that is called normal. Most adults know how to engage in healthy behaviors. Most adults know all about diet and exercise but they don’t do that. Most people know that texting and talking on the phone while driving greatly increases the likelihood of a car accident. And we still do it. And most people know the hazards of cigarette smoking and so on. So try not to be too frustrated when your child knows but does not do. Children, adolescents, and adults usually behave in that same way. An example may be more dear to you, your spouse or partner knows you do not like some annoying habit after all these years. But that person does it anyway. Remember? What is that called? Yes, it’s called normal. You could use shaping with your spouse or partner. But this is a different set of videos, we’re working on parenting and child behavior. Another question that comes up, what if my child does not even do the first step in shaping. Well, make the steps smaller. Ask for less behavior. And, as I mentioned, providing a little help in the beginning is fine if it helps get the first behavior to occur. Just, say, in a matter of fact way, here let me help. Or, let’s do this together. And if that is still a problem, that you can’t get the behavior, take a look at the separate video on simulation. Two cautionary notes, shaping fails mostly because parents set the bar too high in the beginning. If you demand too much behavior, you want to get that hour of homework and you say, well, maybe I’ll start with 45 minutes. No, start smaller, much smaller, and build it up. If you start with 45, chances are you’ll get nothing. We can reach the final goal, not a problem. But it usually has to be done gradually. Parents, sometimes, have difficulty with that and mostly because they feel the child knows what to do, but isn’t doing it. We’ve discussed that already. Try not to be too frustrated. Knowing does not build habits. But doing does. A second caution I call slippery slope thinking. In shaping it is fine, and even helpful, to assist your child with the first few steps in shaping. You could sit with the child and help with the first few minutes of homework. Maybe just five minutes and the child does the other five by herself. You can help like that on a few occasions. Parents often have slippery slope thinking if I have to help now, I’ll always have to help. If the child can’t work on his own now, he’ll never be able to work. No. It turns out just the opposite is true. You help a little bit, you don’t have to help anymore. Try shaping behaviors that, otherwise, will not occur can be attained by this gradual approach. Remember each video discusses a tool to change behavior. But more than one tool can be used to make the changes you want. Shaping is one way to develop the behavior and that is not to be performed just the way you want. Praise the steps along the way. You can use other rewards, points, or privileges. Praise will do fine. As always, the magic is not in the rewards but getting the behavior you wish, or small portions, to be practiced repeatedly. Repeated practice builds habits. Changes the brains. Our tools are not for a temporary fix. They are temporary procedures to use for a little while but the behaviors of the child continue after you stop. We will have more videos and more tools for you in the coming days.

6:04

There are steps to use modeling to develop behavior. Modeling used in the special way we are discussing has four ingredients. First, select a characteristic you would like to develop in your child. Begin by discussing with your spouse or partner exactly what characteristics you would like in your child. Let’s say we want our child to be kind to others. I have just selected this arbitrarily. It is for you as a parent to decide what to select. But let us work with this, kindness is very general but a fine place to start. Now we go to step two. After this general term, list specific instances or concrete examples of that characteristic. Write down the general term kindness, now list some examples. What would you count as examples of kindness? What would kind acts or gestures look like? The examples might include helping other children, sharing things with other children or a sibling, comforting someone in distress, or letting other people go first in a game. You get the idea. We need just a few concrete examples. These are examples of the behaviors not all possible variations of kindness. The reason is that, once we teach a few acts of kindness, it carries over to other areas that we have not specifically train. Step three, now we need instances of modelling the specific behaviors, so the child can see them being performed. Now modelling doesn’t have to occur each day or anything that intense, but modelling instances are needed. Fortunately, there are many ways in which the specific behaviours can be modelled. Here are some of them. As the occasion arises, you could be that model, and that would be great. So if there’s an opportunity to be kind, engage in that behavior and point this out to your child.

11:38

In child rearing and parenting, we speak of being an askable parent. An askable parent, that’s a parent the child can come to to ask about anything, and in fact, talk about anything. Now, modeling can help make that happen. Early in life, model, you as a parent, model talking about the details of your day. If nothing interesting has occurred, talk about something in your past, a story from your school years. Model talking about things, including what happened and how you felt about it. Maybe you were teased at school. What happened? What did you do? How did you fee, how did it work out? The type of conversation modeled by a parent can go very far in making the child able to converse with you about similar topics. Get that going on a daily basis. You do not need to talk about anything dramatic, you don’t have to say your child, you know, he’s not really your father. No, no, no, just talk about mundane things. Talk about every day things at maybe the dinner table. When you and your spouse and partner are there, talk about what happened during the day. What were the sources of tensions? What was bothersome? What went on? Give some of the details. Who did what and how? If you model this regularly, that will do a lot to get your child to talk about his or her life, and confide in you more. So we can explain to the child that she can tell us anything, but that’s not going to do very much. Modeling and practice can turn that around very, very quickly. Some questions and concerns emerge when one discusses modeling. You may have some questions about the procedure as a behavior change technique. One question that comes up, how effective is modeling in changing my child?

13:18

Of course, we cannot guarantee what the modeling will do to change your child. Children and adults have natural dispositions to do some things more than others, and we cannot just change everything we want because we provide modeling opportunities. Yet, what we are doing is greatly increasing the likelihood of getting the behaviors you want. The technique is modeling more systematically than usual way we do this in everyday life. Identifying what you want your child to do and then modeling is much more likely to get the behaviors you wish. As importantly, if your child ever does one of these behaviors and you praise it, that will definitely help lock it in. Modeling plus praise for the behavior is clearly the winning combination. Another question, how will I know this modeling is working? Well, in parenting that’s really a great question. We sometimes see immediate effects, so you show your daughter how to swing a baseball bat and she learns how to hit the ball a little better. You see it right there, right away. Or, when you’re driving your car, someone in traffic cuts you off and you swear Now you see your child say that at home the next night when he’s interacting with the sibling. Do not fear, you don’t have to be a perfect parent and modeling is influenced by how often you show the behavior. In child rearing and parenting, sometimes the behaviors emerge right away, but often much later when the child is an adolescent or a young adult. And some effects emerge when your child eventually has children. So, parenting is for the long haul so model behaviors you wish to develop with that in mind. Some behaviors might be important if they occur now but a lot of the behaviors might be occur as they take place over the course of life.

4.Consequences – Positive Reinforcement
0:00

In this video I will introduce a new technique to change child behavior. The technique is referred to as developing positive opposites. The technique to turns out to be an effective way to get rid of behaviors you do not want. Does your child engage in any behaviors you would like to get rid of? So for example, maybe she does not take no for an answer without a massive tantrum. Or maybe your son teases or argues too much with a sibling or peer. Or maybe he acts out at a supermarket and really embarrasses you. Developing positive opposites is an effective way to get rid of these and many other behaviors. For all these videos in the series, if you are able to get the behaviors you want without special techniques or tools we are describing that is fine, wonderful. We are discussing techniques to help you and give you options that have been well-studied in research for those times in which the usual parenting practices may not be working. And this particular tool today will be of interest, but a little spoiler or a warning, you may be very skeptical about this technique because it is counterintuitive. You’ll be skeptical because in getting a child to stop doing something our first natural inclination is to punish it. This technique is the effective alternative to punishment. The technique has a lot of research behind it so we know about its effects. I’ve actually used it many, many times, a few thousand actually with children over the years. Something really interesting about us as humans is related to the technique we are discussing. Our brains naturally focus on things we do not like in another person. The reason is that our brains are hard wired to pick out things in the environment that are negative, bothersome, or annoying. This is called negativity bias and is considered to be adaptive in evolution. We naturally turn to things that might be bothersome or harmful, something in the environment that might be dangerous or at least deserves our attention and this bias carries over to our interactions in our daily life and to child-rearing. So if two children are playing nicely but start to argue, we’re likely to jump in and pay attention to the arguing. We’ll probably just ignore them when they are playing nicely and that negativity bias is related to today’s technique. We have to go against our bias and our first impulse to run in and punish. Developing positive opposites is not a punishment technique but still a good way to get rid of behaviors. In any case the first part of the technique is identify some behavior you want to reduce or eliminate in your child. This is the easy part and it comes naturally to us. The second part is identify what you’d like the child to do instead of that behavior. It is called the positive opposite usually because it’s the exact opposite of what you want to get rid of. So you want to get rid of your children fighting over a TV show. What’s the positive opposite. Sitting and watching TV together nicely. So you want to get rid of your child throwing his clothes all over the floor in his bedroom. What’s the positive opposite. Placing them in his dresser or in the closet where you’d like them. So you want to get rid of your child getting out of bed again and again for a drink of water and ice and now to the bathroom, and another not a drink or water. What’s the positive opposite? Going to bed, maybe getting up no more than once and staying in bed once you go back to your room. You want to get rid of your child arguing and shouting at you whenever you say no to something. What’s the positive opposite? Expressing anger calmly and doing what you asked. You get the picture. You know what you don’t want the child to do, but what behavior exactly do you want him to do instead? Step two is identify saying exactly what that behavior is. Sometimes it’s the exact opposite and sometimes it’s just a more appropriate behavior that you want in his place. Third ingredient, the third part is praising the child when you catch her doing the positive behavior. In a separate video, I talked about how to provide special praise that’s effective in changing behavior. That’s the praise we want here. We want to emphasize in this technique of developing the positive opposite. The slogan is catch the child being good. But remember our brains are wired to catch something wrong so catching the child being good, and then acting on that is not so easy. Of course it’s not being good, it’s about the child doing specific behavior. So this third part is praising the positive opposite. Brief summary. Three components: What behavior that you don’t want the child to do? Second component, what’s the opposite behavior you want there instead? Third component, praise the positive opposite whenever you see it. Now developing the positive opposite puts the emphasis on replacing or building the behavior and now will lead to a decrease in the behavior you want. Now as you do this, you may still have to punish behavior once in a while, I will come back to that in a moment. But here are some common examples about how to use positive opposites. So your children are not always fighting with each other. Try to go to them and say, “You two are playing so nicely. That’s wonderful to see you get along so well,” and then maybe touch or hug them. Do that a few times a week and that will really reduce the amount of times that they fight when they’re watching TV and at other times. So you say your child never goes to bed on time, well he may go to bed close to the time you want and when he does say, “It’s so nice the way you went into your room and got ready for bed right away.” Those things will decrease the problems. There are some questions that this procedure may raise in your mind. If my child does not do something I want, why don’t I just tell him what he should do and punish him if he doesn’t do it? Well this is the part I mentioned that is probably counter-intuitive. Telling children, or one spouse, or partner what to do and then reprimand or punishing does not work very well. As a matter of fact it usually doesn’t work at all. An assumption is that if we just punish behavior the good behavior will come through. But it doesn’t work like that. Research shows that it is actually false. So for example, if you punish a person for being nasty or dishonest that does not teach you how to be kind or honest. And if you punish your child for talking back that does not teach the child how to speak nicely to you. So punishing some behavior, you will just stops the behavior for the moment, but it doesn’t really teach the skills that we want the child to have. Developing positive opposites can really lead to permanent change and decrease or eliminate the need to reprimand. Another question that comes up so what do I do when the child still does the behavior I’m trying to get rid of? I have to do something. Yes, the positive opposite procedure is not going to work tomorrow. It takes a little while. So use mild or brief punishment. No shouting. No hitting. These can lead to other problems or brief timeout, maybe take a privilege away for the evening or for 24 hours but give emphasis to your praise for the positive opposite. The more you do that the faster the behavior change. Another question. How long do you have to do this? Well it’s hard to answer because children are all different, parents are all different, and how often you do this will make a big difference. As a general rule a couple or three weeks should be enough. You develop this behavior and the negative behavior drops out. So let me summarize by telling you again what the procedure is. Developing positive opposites definitely try this at home. It’s a difficult tool to use because it doesn’t come naturally. A curse of all parenting that haunts all of us is the following maladaptive thought, “My child knows what to do but he just doesn’t do it.” Well this frustration actually applies to children, adolescents, and adults. It is quite common for people to know something well, but not to do it. For example, we know from our own behavior and from research that knowing and doing are not connected very well. For example, we know we should exercise more, we should be eating lots of broccoli, we should be following a Mediterranean diet, we just stay away from fast foods, we should follow through with all those new year’s resolutions. More often than not we do not follow through. And in psychology the technical term for that is called normal. So telling ourselves or telling someone else does not develop habits or consistent behavior, developing positive opposites is a way to build behavior so the child actually learns what to do, does it consistently and has this as a habit. These videos cover many tools and one of them is useful as a way of making permanent changes, but they usually have to be used together. Developing positive opposite is one really good tool and it will reduce your frustration. You can now develop a behavior without reprimanding and screaming at the child.

0:00

Providing a positive consequence after a child engages in behaviors you want to develop is a very powerful tool. These consequences are called positive reinforcers. You may think of them as rewards, but the term rewards make us think of trinkets and candy and the like, and these are not what we need to use at all to change behavior. In fact, the most important positive consequence you could provide routinely is praise. In a separate video, I described a special praise and how it is used to change behavior. In this video, we will talk about giving concrete positive consequences and, specifically, the use of points. Unlike praise, points are a tangible reward that the child earns for engaging in behaviors you wish to develop. These are called Point Programs. This means that the program uses something like points or stars or checkmarks or tickets or tokens of some kind. What is used as the point or token doesn’t make any difference in how the program works. These points are given when the child engages in the specific behavior or habit we want to develop. In everyday life, we call them point programs, but the technical term is token economy. And you are very familiar with key features of this because money, in our everyday life, is part of a token economy. We earn tokens, money, for things we do, and we spend these tokens on other things. As a tool to change child behavior, point programs focus on developing specific behaviors and are more systematic than usual economy where we use money. Perhaps you are thinking, the last thing I want to do is to give my child points for good behavior. You should just do the behavior when I ask and I should not need to use praise or points. I completely agree. But if your child does not do the behaviors you want, praise and point programs can really help. A great deal of scientific research shows that the programs could be very effective. This does not necessarily mean you will want to have a point program to change behavior of your child, but it does mean that point programs are another tool you would want to have in your behavior change toolkit. So what is a Point Program? It’s a system of administering rewards to develop positive behaviors. It’s a way of structuring the rewards. The points operate like money, they’re earned by the child. In this case, they are earned for behaviors you want to develop. They are spent like money. In this case, the child can spend them on privileges or activities or other items of interest, maybe small toys. As with all the tools we’re discussing, the goal is to increase practice of the behaviors you want to develop, and point programs can do that. So there are five ingredients needed for a point program. The first ingredient, is specify exactly the behaviors that earn points. Be very concrete. For example, it should be something like completing 15 minutes of homework or putting your toys back into your room or getting into bed by 8 p.m. The second ingredient, choose a medium that will serve as points. These can be checkmarks or smiley faces, tickets, stars, even pennies. This is kind of like money. Third ingredient, have a way of monitoring and keeping track of the point earnings. Use a chart or something so you and your child can see how many points were earned. Place the chart on a refrigerator or some place easily seen. Fourth ingredient, specify how many points the behavior or each behavior earns. So for example, if you put your toys away, you earn one star; if you go to bed before 8 p.m., you can get another star. Fifth ingredient, develop a reward menu that specifies what the points can buy and what the prices are. These rewards can include privileges like staying up late, playing a game with a parent, or extra time on a computer. Each reward needs to have a price in terms of how many points are needed to buy one of them. Food and snacks can be put on the list of rewards, but I tend to shy away from these, in part, because we do not want to add extra calories when more children are overweight and because snacks that are the most rewarding tend to be the least healthful. And of course, before you start the program, explain it all to the child. Maybe have the child help in selecting rewards. So let me summarize the five ingredients: specify the behavior that will earn points, choose something to serve as the points, have a way of keeping track of earnings and expenditures, specify how many points are earned for the behaviors, and make a list of rewards and how many points are required to buy them. So consider a typical example. Suppose you were having trouble getting your daughter to follow directions when you ask her to do something. Maybe the behavior you ask her to do is get ready for school in the morning or get ready for bed. You have to remind her, actually, you have to nag a lot. Now, you may want to try a Point Program to change behavior. The behavior to change is minding or following directions when you ask. Now, choose something to service points, maybe stars or stickers on a chart. Now, make up a chart to keep track of these earnings. For this chart, you could draw days across the top with a box under each day and a space for you to give points, maybe paste a star or put a check mark. Now, specify the points that will be earned for each of the behaviors. How many points are earned from the behavior? Perhaps your child can earn a maximum of three stars per day for following any three instructions. Finally, you need a list of rewards. What can the stars buy? And these might be two stars to get the story before bed or extra bedtime, four stars to get a computer game with mom or dad, and maybe 10 stars to get a weekend activity. Add some more so there’s a choice. Have some things that are inexpensive, just a couple of stars, and other things that require saving up a little bit. But it’s important to have small rewards that can be bought right away without saving up. At the end of each day or whenever convenient, choose a time when she can buy something. Whenever she earns a star, be sure to praise her. The praise is really critical. You need to tell her exactly what she did to get a star and praise that. If she gets ready for school on time when you ask in the morning, she gets a star. If she does not do the behavior, she just does not get a star – no nagging. You go off to when you say, “You did not get a star today, but maybe you can earn one for that behavior tomorrow.” And do the same for other instructions that are part of the program. So here’s where programs break down. Parents usually want too much behavior to give out a point. We’re stingy when we do this. Our undoing is we believe the child knows how to do this and can do the whole thing. No. To build habits, we praise and give tokens for small bits of behavior. So, we didn’t get the full hour of homework, but we started out by giving points for 10 minutes of homework. Once we build that in, it’s easy to expand that. In the beginning, keep it simple, focus and try to change one or a maximum of two behaviors but no more. Once the behaviors develop consistently, you can stop giving points and praise for that and replace it with another behavior. Another thing to be aware of, do not give points for long-distance outcomes. So for example, the program will not work if you say if you get good grades, I’ll give you a car. That does not teach the behavior of studying, learning, practicing. We praise and we give points for behaviors along the way. You may have some questions about the program. The first question is, do I really need something as complex as the point program to change behavior? Actually, praise when administered correctly, in the way described in a separate video, is very effective, but point programs can help structure the situation. Points often help parents be more consistent because giving points is more easily tracked than giving praise. So we have found that if you ask parents to praise more, it doesn’t happen very systematically or often enough to change the child behavior. Giving points often helps parents give out praise systematically. The points serve as cues for parents to actually give the praise. Another question, isn’t this just bribery? It seems I’m just paying off my child to get the behavior. No, no, this is nothing like bribery at all, where you try to get something done once for some payoff. We are using consequences and other tools to develop behaviors you wish; we are building habits, we are developing prosocial, appropriate behavior. Usually, this can be done completely with a very careful use of praise, and points can add further. Remember, we are using consequences to get more instances of the behavior – that practice leads to permanent change in the child. Another question, how do I stop this program or do I have to give points to my child for the rest of his life? Like all programs and tools we are talking about in these videos, these are temporary changes in what you do. The techniques discuss a way to build habits, usually, they are temporary changes in your behavior as a parent to make permanent changes in the child’s behavior. You can eliminate the program once the behavior is consistently performed. You can say to your child, “We’re only gonna do the program on Monday, Wednesday, and Friday. Because you’re such a big girl, you don’t really need it anymore.” And then you can stop for a week. You could also switch to praise or praise more instead of behavior. In my experiences, most often the programs just drop out. The child does the behavior regularly and everyone just lets it fade and it stops. Once the program is stopped, will the behaviors get lost? No, not at all. We build habits. The tools we’re discussing maintain the behavior after you stop the programs. So let me summarize; point programs are effective way to change behavior, you need a few ingredients, what exactly is the behavior that will earn points, what will serve as the points – stars or something, have a way to keep track of this – some chart to monitor it, how many points are earned for the behaviors, and we need a list of rewards and what they buy. You might use this if you feel praise is not working or if want to provide more structure. Remember, each video discusses a tool to change behavior, but more than one tool is needed to make the change you want. The point is nicely illustrated in the point programs. You might say, I’ve tried reward programs and they did not work. Reward program shouldn’t work, they’re one tool and they have to be combined with other things. You would never build a house with one tool, and we do not try to build enduring habits in a child with one tool. Even so, the use of praise and points as consequences for behavior are very useful tools. When you provide points, praise exactly what the behavior is the child’s getting points for. Praise is effective by itself, points give you another option. As always, the magic is not in the rewards, it’s in getting the behavior you wish to be practiced repeatedly. That’s what builds habits, that’s what changes the brains. We will have more tools in other videos.

18:10

The first is, what if I suspend the program, if I stop it for a while? My child may go to camp I may have to go away for a few days. Or we go on vacation and are away. What effect does that have? Well, it is fine to temporarily suspend the program if you cannot do it well. Doing the program partially and well is better than keeping it going and doing it poorly. If you have to take a week off, take a week off and then get back to it. If you can only do it properly on weekdays, take weekends off. It would be better to do it exactly right all of the time. But the program will still show useful results if you cannot do it and just do it most of the time, as long as you can do it pretty well on those occasions in which you do it. For vacations, parents often develop a small point program for a few behaviors. For example, during the car ride and other places where they might have some problem behaviors. And you should feel free to do that. And remember, you have the most potent behavior change tool with you at all times, namely that special praise for the behaviors you want to develop. A second question, what if I’m divorced or separated, and there’s joint custody? My child may have the program just in my home. Is there any point to that? Yes. If you can carry out the behavior change program in only one of the two places where the child stays, that can still make a huge difference. Of course, if the child is at one place more than the other, that would be the better place to have the program.

19:44

In many instances we’ve had parents keep some of the program going in each home after a separation or divorce. But the relief is, that’s not necessary. We can have success in your home. And once we have success in your home, we can get that to transfer to the rest of the world. A third question is about consistency. The techniques call for consistency on my part as a parent. And am I undermining the program if I relapse and yell at my child, or even hit the child? Have I undermined all of the progress? No, if you go off the program, and stop praising the behaviors you were trying to develop, that is not a catastrophe. It’s very much like going off your diet and eating a whole cheesecake, or breaking your vow not to smoke. What do you do now? You get back on your diet soon as you can, and you get back to not smoking as soon as you can. And here we are, get back on track with your child and the behavior change toolkit if you feel you’ve departed from the techniques. We are humans first, and the program can fail if we raise the bar too high for the child. I talked about that. Also, we do not want the bar to be too high for you. Implement the techniques as I described them to get the changes you want. If you go off and miss a day or so because of your own situation and circumstances, that’s called being human. These videos are intended for humans, I’m not sure if I made that clear from the beginning. But they are, so keep the bar realistic. Well, let me close by making a few points. First, if programs are not achieving the effects you wish, there are all sorts of options that can readily change that. Two, I have seen programs turn around completely and very quickly, once the changes are made.

0:00

This is the second installment on adolescents. The first installment adapted some of the tools we have already discussed, so they are more applicable with adolescents. We cover changes in delivering that special praise, attending and planned ignoring and punishment. In addition to these tools, I wanted to outline other tools that are of special use during adolescents. As your pre-teen and teen develops, there’s great value in making changes in how you communicate with them. The techniques for the day, focus on how to navigate and minimize problems and potential disputes through different strategies of communication. Let me begin. First, it is important to make a special effort to compromise. From early childhood on, parents make decisions for their child and these include what children eat, what clothes to wear, where to go when you leave at home and so on. Of course, all these decisions are essential for development and the child safety and just managing the home. Over time, children develop more autonomy and have taste what to wear and what friends to play with. In the teenage years, there is more of a qualitative leap as the need for independence and autonomy increases. Here, peers can exert enormous influence. By adolescents, your child has formed views on things such as – how to dress, what to eat, where to go, which friends to be with, as well as what beliefs to have on major life topics and what values there are. And many of these views seem to be purposely opposite of those you have. All of these views might well change later, but there may be clashes at this time. Among the issues likely to emerge are differences in rules in the home, and what is and is not allowable in the behavior of your adolescent. You can help your adolescent and yourself by making much more of an effort to develop compromise in relation to the rules that guide your adolescent. Of course, many things cannot be compromised to run family life, but try to compromise when you can and let some things go that you are inclined to forbid or weigh in on. Decide what you might be willing to let go. Here are some things to consider about being flexible on and grounds for compromise. Maybe bedtime can be flexible especially when it is on a school night. Could curfew be extended once in a while, or can you let a messy room go? How about strange outfits and personal appearance? Would these be options to compromise or let go for you? One creative compromise was brought to my attention in relation to a teenager’s messy room. The teen wanted her room completely to be her domain and never wanted a parent to ever come in. The mother wanted the clothes picked up and placed in drawers, closets or a laundry hamper and there was literally a one to two-foot pile of clothing, books, magazines, bags from stores and more that covered the entire floor. The mother complained that one cannot even see the floor in any part of the bedroom. The compromise ended up being, that the teen could keep her room exactly the way she wanted and the mother would stay out of the room with three exceptions. First, there could be no burning of incense or candles that would risk safety and even the slightest whiff of something burning would allow the mom to come in and take these items away. Second, there could be no leftover food because that would foster insects, rodents, and horrible smells. The daughter often brought snacks and sometimes dinner up to her room and would leave the plates with leftover food somewhere on the pile of clothes. Third, the mom could come into the room if the family ran out of silverware or plates because the teen just kept them in a room after eating snacks. And about once a week, the family ran out of something – dinner plates, forks, juice glasses just because they accumulate in the daughter’s room. If this happened the mom could come in and retrieve them. The compromise, the mother did not insist on a neat room but compromise with some conditions that seemed reasonable. The teen had control over her domain and the teen could keep them out of the room completely, by handling some of the problems like returning food and silverware and dishes to the kitchen once in awhile. In your family, what can you compromise that stays within your comfort zone? How about green hair, torn jeans? How about a backpack featuring some very strange stickers and marking, could you let that go? How about goth or vampire like clothing and makeup. Can you compromise a bit? Also for skirts, pants and tops. Is there something too provocative for your taste? Or is there any room for compromise? I am not advocating any specific change or recommendation. Only you can identify what can you can be flexible about your values and tastes will guide you. But compromising on practical issues will require you to bend a bit. My recommendation to parents is to consider allowing adolescents to engage in actions that are likely to be temporary and will not jeopardize safety or health. This consideration will allow colored hair, strange clothing combinations, and bizarre jewelry, even maybe a dog collar around one’s neck instead of the more common necklaces. I consider this temporary and developmentally based because in 10 years from now and probably a lot sooner, the adolescent would not be caught dead in any of these and even deny that he or she wore odd clothing and jewelry. Of course, be sure to take some photos if you want a proof later. There may be many gray areas, and as a parent, you will need to decide what is allowable. Many parents feel that using birth control, driving at night and spending all night out at a party or prom are not a place to compromise. Other parents feel that tattoos are completely out of the question but some parents may allow tattoos if they are appropriate and relatively hidden. The tool for this lesson is to urge you to compromise and expand the areas that you’re willing to compromise. Teens want more independence, you being able to reach compromises and give in on some things will contribute to that independence but also make you much more effective as a parent. Compromising for some parents raise the myth of the slippery slope. Many parents feel that if they give in or compromise in one place this will be a slippery slope and pretty soon more demands will be made. So maybe it is better to stop all that early. Set the rules and not compromise. Actually, it looks like the slippery slope concern is not a real problem at all, the opposite is more likely. By opposite, I mean like compromising has a host of benefits. When you compromise you serve as an influential model for your child in a few important ways. You are modeling and providing a great example of what it is to compromise and to be reasonable and how two people can disagree but come to terms without a fight. In addition, you’re compromising on some issues is likely to strengthen your word and the rules in place where you cannot compromise. So if you can yield on a few things to allow your adolescents some more independence and freedom, do not worry about a slippery slope. Instead, you have made yourself an ally in one more way and are there to provide support. You have also further cemented the positive facets of your relationship during this difficult period when the relationship might be strained. All of that will make you more effective when you have to intervene when no compromise is possible. The second tool is to negotiate with your adolescent. Negotiating is related to compromising. A compromise refers to the outcome or actual solution that you reach, while negotiation refers to the process of how to get there. Negotiation has several features that will greatly facilitate parenting and child-rearing, even when you are not facing an issue or an impasse. Let me start by clarifying what the opposite of negotiation is. That would be doling out of advice and making decisions without any real input from your teenager. When your teen was a young child you had to do this to get the child to this new stage of life. There’s not much in the way of negotiating about what preschool to go to, or what brand of diapers to wear, or when to begin wearing shoes. You are in the normal habit of taking charge and your child would not have made it to adolescents without you doing that. Fast forward to adolescents. Now, any effort to control or even influence facets of the adolescence life could be met with resistance and oppositional behavior. Of course, there are some decisions you still have to make without your child. Even so, there are opportunities to involve your adolescent in decisions and negotiation is the key. Negotiation is a process and here are several guidelines and steps to help you. First, listen to what your adolescent says without jumping in. Really listen, pay attention and hear the entire story your adolescent wishes to say or his side of the story. Remember the expression that sometimes the opposite of talking is not listening but just waiting your turn to talk. You do not want to do that here. You are actively listening and genuinely hearing something that may sound irrational or naive or maybe not. It doesn’t matter you are there at the moment and really paying attention. Second, be respectful of the teen. On the one hand, you may sometimes feel like your teens statements were dumb, they reflect poor judgment and they indicate that your child-rearing did not register at all. On the other hand, you’re hearing how your adolescent thinks about things and that is very important and as you listen you will probably be surprised by how reasonable and understandable the request is. Withhold judgments and refrain from rolling your eyes or looking in the air in disbelief. Body language counts as judgments. Listening is paying close attention, add respectfulness, which conveys that the content is being taken seriously for the moment. Third, focus on the present and not what the teen did in the past. Parents often call up similar situation where a teen made an error or something did not work. This is the kind of indirect, “Here we go again or I told you that would happen the last time you did this.” You may be right, but at this point being right is jeopardizing the process of negotiation. At this stage, we are in the middle of a process, so stay exactly in the present. Fourth, stay on the subject at hand. Try not to go off, raising the past as a sample of that, but in general, try to jump off to other lessons or situations. Do not drag up some situation that the adolescent will view as completely irrelevant. That would be a signal to the lesson that you were not really listening and you do not have the slightest understanding of what they are thinking. Finally, when it is your turn to talk, provide alternatives and suggestions for how to proceed with the situation. There are two parts of conveying your suggestions. First, provide a number of options of how to proceed, that might include two or three possible solutions. Second, present them in a way that is not authoritative. So try not to say anything like, “Here’s what you should do or this is what needs to happen.” Rather, leave with a sentence like, “Here are some alternatives we might talk about or have you considered this or that.” Each of those gives the adolescent a voice and allows for further negotiation and compromise. Also, the adolescent is much more likely to agree to one of your options or generate a compromise based on how you present the possible options and whether choices involved. The five steps I have outlined for negotiation are not so easy to do, especially if the focus is on something that you or your adolescent feel strongly about. At the Yale Parenting Center, we have actually brought parents in and teens in sessions into a room and have them practice negotiation on an issue that’s not very critical. So just planning a hypothetical vacation just to develop the negotiation skills, and then we give them something challenging that they select from their own lives. We can jump in and coach and keep the process of negotiation. But you can do this at home, maybe start your negotiation on some event that is not so volatile or provocative and when the stakes are low. The negotiation process will help you reach an acceptable compromise on a given issue. But as importantly, this process will help your overall communication, your relationship with your adolescent and your adolescent ability to come to you knowing that you will listen without making judgments. A final tool for this lesson is to engage in problem-solving with your adolescent. Problem-solving is a way of handling difficult situations especially difficult social relationship issues. These could be interaction with peers, teachers, coaches or girlfriend or boyfriend and of course a parent. Problem-solving consists of several steps. Let me say what they are and then apply them to an example. First step, identify and state what the problem is. Second step, prompt and encourage the identification of potential strategies or solutions to resolve that problem. Third, identify two or three possible ways of handling the situation or general approaches to the problem. Fourth, for each possible way to handle the problem identify what its consequences might be. Talk about each way and what is likely to happen if you did that solution. Fifth, select the solution that is the best in view of the consequences. Finally, through role play, practice and act out the situation and the best solution you selected. For example, let’s work through an instance in which your child, your teenager is being bullied by someone at school. The first step, is to state the problem, that’s easy. You might say, “So Jack, is picking on you at recess.” The second step, is to prompt and encourage the identification of potential strategies or solutions. So you say, “What are some of the things you might do to handle that?” The third step, is to identify two or three possible ways of handling the situation or general approaches to the problem. So now you both identify some possible ways of handling that situation. You do this together and if you’re adolescent can take the lead on one of these that is better. But jump in if needed. So for example, you might say, “Well, one thing we could do would be to talk to the teacher.” Now, ask your teen, “Is this something else we could do?” If not, jump in again and suggest another possibility. You might say, “Well, how about staying away from Jack at lunchtime because that is when this seems to happen. “ And now try to get one more solution. We want the adolescent to suggest a solution just to engage in the problem-solving process even if the solution is not that great or feasible do not judge it at this point. We are shaping problem-solving behavior and the next time you apply this approach you will both be better at it. The fourth step, now go through each possible solution one at a time to identify what the consequences would be. Here, your teen can play a role and you can jump in less. You say, “Okay, one strategy is to go to the teacher.” If you went to the teacher what would happen? And now you give the same verbal prompt for each solution. You say, “And what would happen if you stayed away from him at lunch?” Trying to get your adolescent to talk about the consequences. The problem-solving approach includes you not taking over all or even most of the talking. Briefly, discuss the likely consequences for each of the proposed solution. Fifth, now choose one of the solutions that is the best of the solutions based on the different consequences. You say, “Okay, which seems to be the best solution?” Now, you and your child discuss the need to choose just one. Finally, the six step is to practice. You and your teen actually practice the best solution, you both role play, you as a parent pay the bully and your child pretends to be himself in the situation and he acts out the best solution. Then you switch roles where you play your adolescent and he plays the bully. All of this is done, stand in place but you’re both pretending. Try to make this fun. So something should be redone in the middle of this. Just laugh and say, “Oh, let’s start all over again.” The tone of this is constructive when everyone is calm. Introducing anything to light and the task is fine. Going through all the steps is the problem-solving approach. As you can see this is very different from dispensing the solution to your adolescent. Problem-solving teaches a different way of coping with and handling interpersonal problems and research shows that this approach helps across a variety of interpersonal situations with peers as well as with adults. Also, the process greatly increases the quality of the communication between you and your adolescent. Let me summarize what I’ve covered so far in this lesson. We’ve added three tools to the toolkit that are especially valuable in relation to parenting your adolescent. These were compromise, negotiation, and problem-solving. As with other tools, we have discussed in this course, the terms compromising, negotiation, and problem-solving are familiar and are used in everyday life but how they are done is very important. For example, negotiation and problem-solving involve very specific steps to achieve their benefit. Informal problem-solving by just chatting about problems with your adolescent may be a very good way for improving your relationship and overall communication. But the steps I noted have been tested and showed to provide the adolescent with important skills in handling difficult situations and the benefits extend across many areas in everyday life. The notable feature of the techniques I discussed is that they help resolve particular situations that need to be addressed but they also have broad benefits, such as – strengthening your relationship with your teen, making you much more approachable, and teaching by modeling how to address difficult situations. In any case, you have some more tools now to ease the path. Keep in mind that you made it through your teen years and are probably doing very well, your child becoming an adolescent and an adult will probably do well too. And if you need a little extra help, if you feel frustrated or if your usual procedures are not working the way you would like, you have a variety of tools and some of these are really well suited to adolescents.

0:00

The majority of lessons in this course cover specific techniques that are effective in changing child behavior. The overall goal has been to help with the challenges of parenting and child rearing by providing specific tools you can really use and that research has shown to make a huge difference. In this lesson, I consider more general facets of family life that greatly influence child development and the behaviors in the home. As with other topics, many of these will be familiar but I hope we can add some new features that will be practical and improve the effects of what you already might be doing. Consider the overall theme of this lesson as creating a nurturing environment for the child in ways that are likely to set the stage for easier child rearing and parenting. There are all sorts of influences that might create a nurturing environment. I have selected eight and what can be done to help family life. Let me begin. First, it is important to promote good communication with your child as early as possible. Good communication, first in genuine exchanges in which you and your child talk to each other even more important listen to each other. The specific topic under discussion are not as important as developing and sustaining open lines of communication. Now most parents feel and say that their children can talk to him about anything. Yet while most children want to go to their parents about difficult topics they often shy away from actually doing that. They expect that when they raise the touchy subject the parent will respond with opinions, give directives about what the child should do, and moralize about something. It would be great if children could come to you more freely about difficult topics. Open lines of communication are important because it will help you identify any problems in their early stages and intervene if needed. Here are some things you can do to promote better communication. First, realize that telling your child that he or she can talk to you about anything will not open the lines of communication. Reassurance will not help at all because the child knows your views on many topics and the opinions you’re likely to give. Second, be an especially good listener. This is easier said than done listening to promote good communication means paying close attention without jumping in or offering an opinion or judging what was just said. Of course, this is not true for every issue but the goal is to make open lines of communication and it’s better to just listen to the full story before jumping in. As an example, once one of my teenage daughters came to me and asked if we could talk as if I were a friend rather than her dad. This caught me very much off guard, rather than try to convince her that I was her dad and not a friend I kept quiet. My daughter asking for a friend in me gently implied that I should just listen, not jump in with my usual comments, and keep my parental judgments to myself. I listened and she discussed some relationship issues at school; her thoughts about it, what was good, what was annoying and so on, nothing catastrophic and nothing out of the ordinary. She spoke for about 15 minutes. I recall nodding once in a while but not really saying anything. When she finished talking she got up from the chair, walked out of the room and said thanks and just left the room. Now I did not do very much. I just listened and apparently, that was really important at that moment. The larger point is important. Do what you can to really listen and to actually understand what you’ve heard and what’s being said. And of course, you have all sorts of opinions and judgments, just try to delay in giving them. I’m not suggesting that you hold back your views. After all, you’re responsible for teaching the child a lot yet to build better communication invest in better and longer listening. That will help enormously in opening up the lines of communication. A third thing you can do and maybe the most important is to be a model for open communication. What that means is that you model talking about yourself and sharing your day. Create opportunities to talk about your day, any stressors and what happened. If it fits your style, it would be useful to even have a regular routine. Maybe at dinner time when parents and children talk about things that happened during the day, what was interesting? What interaction occurred? What were the difficult situations? This does not have to be everyday but should have some regularity. The goal of modeling is to establish a family norm that we talk about things that happened during the day and what’s happening in our lives. Again, this message is not going to be conveyed by simply saying we can talk about anything at the dinner table. Rather, the message will be conveyed by modeling, by showing exactly what you mean by talking about events of the day. That can go a long way toward fostering good communication at dinner and beyond. A second way to provide a nurturing environment is to build positive family connections with relatives outside the home. Of course, the quality of your relation to the child is the most critical. In addition, the quality of interactions with relatives living in the home and outside of the home can be of great value in promoting positive behavior in your child. If you live near relatives, try to promote child connection with one or more of them. Those relatives can exert a great positive influence by having another person to talk with and who cares about this child. Children with positive family connections do better in school and are less likely to show behavioral problems and clinical dysfunction as they get older. Here are some things you could do: If it’s possible to promote these family connections regularly. Be sure your child is present, if you go visit a relative just make sure they’re with you. Try directly visiting relatives. Regular visits are better even if they are only once in a while. Encourage a favorite relative or two to come to your house maybe even babysit. If relatives live too far away to regularly visit, more frequent sessions via computer and live interactions by the computer screen that can help too. The child’s bonding to other relatives can readily help family life and adaptive child functioning in home and at school. Just a little bit more deliberate promotion of these can help your child a lot. A third focus for family life is to include routines and rituals. Routines and rituals refer to regular and predictable activities. By rituals. I do not necessarily mean anything religious but religious activities would certainly qualify. Rather, I mean activities in which there is an order of what is done and things unfold in expected ways. The quality of family life is greatly influenced by regularly scheduled activities that give structure to the week or the month or the year. Research suggest that it is the regularity of the activities that is important rather than the specific content of what those activities are. Having such routines and rituals helps reduce stress and anxiety among children and also helps children avoid some risky behaviors as they turn to the teenage years and become young adults. So here are some things you can do. As I mentioned routines and rituals do not have to be special events. They can be very much everyday activities as long as they involve your family and your child. Every Friday afternoon, for example, you might go food shopping or on Saturdays you have a pancake breakfast or you stop at a certain park when you come home from grandma’s house. Any of these- a regular drive to get to a park or go to a baseball field and play for a bit or go for a walk. The regularity of that will be really important. Perhaps one day a week, maybe the same day, would help make this a very good routine. Aim for regularity and frequency but do not be so rigid that the routine becomes an additional source of pressure. Something once a week is totally fine. If you can have a couple of these regular activities that would be great. The nice thing is that regular events in your home and regular activities outside the home all qualify and they do not have to be special. A fourth focus is to promote positive social behavior especially early in childhood. By positive social behavior, I mean getting along with others, cooperating, being sensitive or responsive to others and just interacting harmoniously. Children vary greatly as do adults and their temperament and their propensity to socialize. Some children immediately join in with others, play, and start talking. Others are much more reticent and shy. There’s no need to try to turn a shy child into an extrovert. At the same time, it is useful for children to learn to be around peers and to get along. There’s more here than meets the eye. We know much from research that children who engage in positive social behaviors do better in their schoolwork and are also less likely to engage in disruptive behavior, bullying, substance abuse, and anything risky later on in their teens. Over the years, research has shown that these positive social behaviors are especially important early in life. To prepare children for entering school, for many years, the emphasis was on early exposure to academic activities such as learning how to read as early as possible. Reading is important of course but current views focus more on social behavior. That means preparing children for school by developing their ability to interact with others, to cooperate, to share, play nicely, and listen to adults. So, positive social behaviors are important early in life and their importance continues in elementary through high school years and of course in our adult lives as well. So here are some things you can do to help your child develop these social behaviors. Develop good relations with others as opportunities arise. If social relations come pretty easily to your child, it will not take much work for you to cultivate these skills. But look for ways to increase the number of opportunities for positive social behaviors, especially if they are not occurring often enough now, to reinforce and build on. A playdate, a sleep over, taking one of her friends with you on a family outing once in a while that might be all that is needed. Also, if there are neighbors to play with casually or other play opportunities that require a little arrangement, all the better. As your child engages in social interaction, monitor how your child is doing, especially with younger children. Parents almost always monitor for safety, but I’m talking about a different kind of attention as your child is playing. Do you see any problems in sharing and taking turns or being reasonable with other children? If you are seeing a repeated negative social behavior that you want to address try to prompt and then praise the behaviors you think that will be helpful. More generally, praise positive social actions as you see them because that will lock in. Remember, you have one of the most powerful tools and in our toolkit with you all the time and that’s that very special type of phrase that we’ve talked about. Now if your child does not engage in social interaction very willingly, use antecedents to promote particular social behaviors. You shaping to develop small portions of the behaviors and use the special praise for the behaviors you believe will be good to develop given what you know about your child. You may need to help out a lot especially in the early stages. For example, by walking a younger child to the park and staying nearby when she plays might be just what helps get started on these social skills. Commands that you make such as just go over there play with those kids like everybody else. They’re not very useful as prompts from many children, better to accompany your child and look for slight social behavior to reinforce, like playing near someone or handing another child a toy. Let your child be your guide as to where shaping begins. Even if your child is withdrawn and does not start up easily with others, you can still work on social relations. Start with a small dose rather than a full sleep over or a full four-hour play date. Shaping a little bit of social time together might be all that you need. If it still seems like a stretch for your child, have him select a friend to accompany all of you on a family outing to the beach or amusement park or whatever activities you enjoy. Your child and his friend will be together but your child has the security of your presence and you begin a process of shaping what will eventually lead to more independence socialization without you so close by. Another way to help build positive social relations is to develop one or more competencies in a child that involve or eventually will evolve activities with other people. It is useful to help your child develop some skill or interest or talent that can continue over many years and pay dividends in social interactions. In relation to social behavior and not all activities are equal. Some are more likely to promote interactions and connections with other people over time. For example, learning to play a musical instrument has the time by oneself to practice but the skill brings the child into contact with other children and lessons, recitals, perhaps the school orchestra and maybe a little band in high school or in adulthood. Other arts, such as theater and dance and sports such as gymnastics or baseball may do the same thing in terms of building competence and fostering social behavior along the way. You and your child will naturally participate in activities you enjoy. But among the possible choices, give special considerations to those that involve activities that are likely to be more social over time and that are likely to be lifelong or near so. A fifth component for developing a nurturing environment is fostering flexibility in your home. Now flexibility refers to openness to change and compromise. And I’m talking about your own flexibility more than I’m talking about the flexibility of the child. Now flexibility can be difficult to accomplish in running a home. There are so many things that cannot be flexible. You’ve got to get a child out the door on time for school. You have to ensure that the meals are there, everyone’s homework is done and so on. But by flexible I mean trying to compromise when you can and more and more as your child gets older and starts expressing preferences. The other extreme would be to have clear and rigid statements. Do this because I said so that’s a move in a wrong direction for a nurturing environment. From the lesson on antecedents, you know that such statements that are forcing people to what to do actually fosters oppositional behavior and more noncompliance. And you know from this course that offering choice fosters compliance. Efforts to compromise lead to more positive interactions overall and increase your ability to get compliance when compromising on a given topic is not possible. Here are some things you can do: First, compromise and let some things go when you can. Consider bedtime, curfew, a messy room, strange personal appearance are these areas you might be able to give in a little? It’d be great if you could. In the pre-teen years and the teen years, torn jeans, orange hair in the style of the Statue of Liberty, and saying the word like five times in every sentence, can you give in on some of these? That would be a good place to start. Second and related for your teenager, negotiate at times when people are calm. Invite your pre-teen or teen to help problem solve with you, for example, perhaps curfew is an issue with some upcoming social event, can you two sit and discuss this and maybe calmly reach a compromise. If you can, include your child in the process, make up new rules whenever they’re coming up in the home and that will go very far in setting the tone and reaching solutions you both can live with. Sixth, monitor the whereabouts of your child and the use of computers, smartphones, and other devices. Monitoring means keeping track of where your child is and what he or she is doing and who’s he with. Monitoring is most important for physical safety in the early years. Obviously, you do not want your toddler running into the street or going off with strangers. But monitoring also plays a very large role in your child’s adjustment, particularly in the pre-teen and the teen years and is an important influence on development. Whether your children are monitored relates to behavior problems that they show and experience. Teens who are monitored are much less likely to engage in sexual activity, illicit drug use, and other high risk behaviors. One area where monitoring frequently comes up is after school time, which can be difficult to keep track of if both parents are at work. It’s even more difficult for a single parent. Yet, you do need to know where your child is after school, who is he with and what’s he actually doing? I mention that adolescents who are not monitored are more likely to engage in all sorts of risky behavior. Add to that, the lack of supervision after school is associated with greater depression and poor grades among adolescents. So, this is the 21st century and monitor your child is more complex because this extends beyond where your child actually is. So, monitor the use of computer, smartphones, tablets, and other such devices. Children can now readily access sites on the internet that you would not approve of such as pornography and they can engage in activities that promote problem behaviors such as video games that focus on violence. Also, they can get caught up in online bullying. It’s important now to monitor your child in the real world but also in the virtual world where the child is engaging in computer activities that are not homework. So here are some things you can do. Establish early in the child life that we all routinely know where everyone is. As your child is developing, make it natural to ask you about activities at the dinner table let’s say, where everyone was, and what they did during the day. Monitoring will not work if all of a sudden when your child hits age 12 you develop a new intense interest in her whereabouts that takes the form of verbal waterboarding. Have your child check in when he or she reaches the cell phone age and checking periodically with them if there’s any possibly they’re not exactly where you think. A second thing you can do is to make your home a place where your child can bring friends while you are there. That of course allows for careful monitoring. Finally, come up with an agreeable way to monitor the use of computers, cell phones, and tablets. Can you see or check what your child is doing at the computer? It’s important to be able to do that. Placing a child’s computer in a public place like the living room where parents can easily see that is a solution but that won’t always work. Seventh consideration for providing a nurturing environment is to manage and minimize sources of stress for your child. A stress is a normal part of everyday life and it’s not something that can be completely eliminated. Yet there are some important things to say about stress. First, be alert to stressors of your child. Children and adolescents experience considerable stress and all of this can become especially high during adolescence. Common stressors they experience: demands from schoolwork, unsafe living conditions, unstable home environment, bullying, concerns about body image and weight control, overly high expectations, and negative thoughts and doubts about themselves. Two points to make about stressors that might be especially interesting. First, research suggests that parents are usually unaware of the stress experienced by their children in adolescence. Children often turn inward and just say that things are fine but they actually are suffering quietly. Yet national surveys show that youth in fact are considerably stressed. Now another key feature to note is that parent stress tends to spread throughout the home. Thus, when you are stressed your children become stressed by those factors. By that I mean they become more stressed than they normally would be if you were not stressed. This can have two effects. First, the child has increased stress. The child has his or her own stress and now a little bit of yours. Also, stress is a setting event, an antecedent that can lead to negative behavior. When you are stressed, you come home after work and say something, it’s likely your child will not comply. I already mentioned that. That’s because the stress in your voice is an antecedent for getting noncompliance. That extra stress in your voice comes across and stresses your child. A second effect of what can happen is that that stress is actually an antecedent for other things that may happen in the child’s life such as not sleeping well at home at night or having problems at school the next day. Stressors are always around. It’s when they’re continuous they disrupt routines and that’s when they increase noncompliance and can add more anxiety. But here are some things you can do. Again, stress is part of normal life. It’s important to be aware of it. You can start by making sure your child is not getting an overdose of it in the form of prolonged household conflict, belittling and dismissive comments, harsh and frequent punishment or unreasonable levels of family chaos. In any life there will be crisis, such a divorce, moving the child away from friends and a familiar school, bouncing back and forth in joint custody and the like. These can be very stressful. Try to be as comforting and understanding as possible and keep activities, routines, and rituals as consistent as possible so they are like what they were before the crisis or stressful event. We know from research that keeping the child in the usual routine helps to manage stress. So, if stress disrupts some family life in some way try to maintain all daily routines that you can and get back as soon as possible to the regular meals, school schedule, bedtime ritual. All that can help stabilize child behavior. Eight and as a final strategy to develop a nurturing environment, remember try to stay sane yourself and be careful about your own stress. It is very important to take care of yourself and that’s not just a cliche. We have learned a great deal about stress in recent years and much of that may be surprising. I mentioned how stress you experience can influence child behavior but we know so much more than that. Stress can speed up the aging process. This has been shown at the cellular level in our bodies. Also, continued stress can change our immune system so we do not fight off infection and handle inflammation very well. The changes in the immune system can be enduring and make us more vulnerable to serious disease such as cancer and heart disease and chronic respiratory diseases. Now none of this has to be alarming but it does add to what we know and makes it even more important to do things to manage your own stress. This course focuses on child development and what can be done to help child functioning at home and at school. You taking care of your stress and managing that is an important contribution to all of that. So here are some things you can do. It is important that you see to your own needs and not just your child’s by building your own downtime or social interaction and your own special routines. Perhaps you and your spouse or partner and friends have special time that you get together. Invest a little energy in yourself. It will pay off for your family and you will also be modeling for your child the importance of taking care of oneself, a skill you’d like your child to learn. You are the best judge of what influences help you remain sane in a complex world. One person may find gardening, another playing in a band, another volunteering or taking a long walk. You are grown up and I would not presume to tell you how to take care of yourself. But the usual solutions may be helpful, such as building positive relations outside the home. If you are in a relationship, preserving from relationship time just for yourself, commitment to a hobby, exercise, involvement in religious and non-religious groups. You know what to do. But is important to make sure they’re in your everyday life. Just be alert here on stress. As the airplane safety instructors, instructions remind us you’ll be a lot more used to your loved ones, if you put the oxygen mask on your own face first and then on your children’s face. So, let me summarize the focus of this lesson. We’ve been talking about the context or broad influences on child rearing and development. While there are many factors to consider, I focused on a few that will influence child behavior and functioning in the home. I also mentioned quite specific things you can do if you wish to add to what you already doing as part of your home life. Now many of the contextual influence affect the level of problem behaviors you have to deal with and your need to draw on the special tools to change and manage child behavior. These influences affect the overall climate of the home. They’re not a substitute for developing specific behaviors, but they will make that task much less challenging. Rituals and routines will make it so less difficult then getting your child to bed or getting your child to do homework. Yet these influences will definitely help even though they’re not as specific as the behavior change tools we’ve talked about.

18:41

Reminders are antecedents, which we have discussed. A behavior change program based only on antecedents, in this case repeated prompts, is not like it help change behavior beyond that moment. To develop behavior so you do not need to reminders, we start out with reminder or a prompt, positive setting events to get the behaviors, and we praise the child for actually doing the behavior. The use of antecedents may be shaping behavior, and consequence together will lock in what you want. Reminders by themselves are not enough to develop behavior. In fact, lots of reminders make the child want to escape from you, and make it even less likely he will do what you ask. Now in some cases, parents see the failure of repeated reminders as grounds for punishing the child, this is a trap. The child’s actions are really quite predictable, given what we know about using reminders alone. And we know that when you add punishment to the mix, that will not help at all. So you’ll be frustrated, even feel bad about yourself. The child will be crying and we’re absolutely no closer to developing the behavior you wish. In short, when you use reminders be sure to have your goals in mind. If you want something done once or twice, and you’re not interested in developing a habit or a long-term habit of change, a reminder all by itself is great. However, if you want consistent behavior, then repeated reminders are just not going to help. Here you need prompts, followed by the behavior, followed by praise. The videos on antecedents and shaping give you all the tools you need to get that. So let me close by covering the common misbeliefs and myths I’ve talked about today. These are partial truths or myths, whatever they’re called, they are huge sources of frustration, because the child will not do something despite our efforts. Many of the beliefs I have mentioned and actions that stem from them, seem rather natural or almost automatic. So for example when our children do not do something or break a rule at home, we punish. Knowing that punishment is not likely to work, does not help us very much. Because our use of punishment just stops behavior at that moment and traps us in continuing to use punishment ineffectively. Fortunately, we have learned how to change behavior more effectively and some of these changes are in how we apply things. So for example, endless reminders will not work, but one or two reminders, followed by shaping and praise can have enormous and enduring impact. If you are caught in any situations or frustration with you child, perhaps briefly suspend the beliefs or assumptions and go to the toolbox. The tools there will not only be helpful in getting the behavior you want, but will make it much less frustrating to interact with your child at home.

0:00

In the course, we have discussed a variety of tools that can change child and adolescent behavior. Our focus has been on helping with the usual challenges of parenting and child rearing. These challenges include, having children comply with parental requests, not having explosive tantrums, finicky eating, completing homework, interacting appropriately with other children and many many more such challenges. But what about more extremes of behavior that go beyond the normal challenges? This lesson focuses on how to tell when problems in childhood and adolescence are just temporary, and part of normal dominance and when behavior is extreme, and it is appropriate to seek professional help. In a separate lesson that follows this, I focus on how to obtain help if your child may need that and things to look for in treatment services. Let us begin with the topic of, ‘Deciding whether your child may need help because of a psychological problem or a mental disorder.’ Let me begin with three critical points about mental disorders that I believe will be of great interest. First, many psychological problems are not a matter of having or not having a problem. Instead, many of the problems are on a continuum. For example, we can tell professionally when a person is clinically depressed, because of extremes in sad mood, not engaging in any of the usual activities, low energy, changes in sleep and eating, and feelings of hopelessness. Yet, these characteristics are on a continuum and someone who has less extreme versions of these features, could still have problems that interfere with their life and happiness, even though they do not meet the formal requirements of clinically depressed as a psychiatric diagnosis. The same applies for hyperactivity and autism spectrum disorder, when symptoms are very clear and extreme, we know there is a problem that warrants intervention. But, these are on a continuum and that is why the term spectrum is used. I will comment in a few moments on characteristics that are clear signs and red flags, but in so many instances, the question for the parents will be, is this behavior or are these signs enough to seek a professional opinion and maybe even treatment? Second point I want to make is a general rule of thumb. If you are deliberating whether a child should get help, then you should probably get help. Trust your intuition. There is no harm in pursuing a professional opinion and great benefit, if your intuition is correct. Let us say you go to see a psychologist or a child psychiatrist to get a professional opinion. If the professional says there’s no problem, this is great and you have the assurance you need. But if there is a problem, it is really good that you identified this early. It is better and more effective to treat a psychological problem in its early stages than much later. A third point has to do with parents blaming themselves for problems that the child may have. Your child may be extremely anxious, hyperactive or depressed. For many parents, particularly mothers, the first thing they do is to blame themselves. You might feel you did something wrong and caused the problem, and then that if you had only done something different, the child would not have this problem now. My brief comments here cannot be expected to erase all of that, but the chances are quite small that you lead to the child’s problems. We know that parenting and child rearing can have huge effects on development. But that psychological problems and extremes in emotions and moods, thought processes, problems of attention and the like, have strong underlying genetic and brain influence. It is not at all likely that you had anything to do with the child having this particular problem. Understandably, you might be stressed and frustrated if normal efforts to help your child are not enough. In all of that, try not to blame yourself. Any bad mothering or bad fathering, is not likely to be the basis for mental illness and related problems. The exception would be harsh punishment, neglect and extremes of parenting practices. Well, there are some points to bear in mind. But still now we haven’t talked about how can you decide whether your child might need professional help. Here are six warning signs that serve as guidelines. The first is impairment. Impairment refers to whether the problem of the child or adolescent interferes with meeting the usual demands and expectancies at home or at school. Now in the early years of being a toddler, the main activities for a child maybe, sleeping, growing, engaging in daily activities at home. Here, there are too many demands and expectations. At some point, perhaps the child begins daycare or preschool and some demands increase like fitting in with others and following routines in that setting. Not much ought to be expected of your child in these early years. So, if your three year old is not a social butterfly at daycare, or does not nap at the time the rest of the children do, these are perfectly normal and no cause for alarm. However, if the child is to be regularly isolated in daycare or is repeatedly kicked out of preschool, these would qualify as impairment. Impairment becomes more easily discerned as children age and enter elementary school and more is expected of them. Is your child’s aggressive behavior, or high levels of activity, anxiety, or depression getting in the way of routine activities such as going to school, completing homework, participating in extracurricular activities, and getting along with peers? If yes, it would be wise to seek professional help. A second guideline is to consider whether the child is of any danger, or is there any risk of danger. Is the child’s behavior any danger to himself or to others? Some things to look out for are, repeatedly being aggressive with a sibling or cruel to a pet, playing with matches and setting fires, making threats to kill classmates or teachers, self-mutilation, and thoughts of suicide. The key is to evaluate how harmful the actions are. Threats should be addressed as soon as possible. For other potentially harmful behaviors, the pattern and consistency are cause for alarm. For example, hurting a sibling by accident and fighting with a bully, might not be signs of an enduring psychological issue that needs treatment. If any of these things occur regularly, you should seek professional help. Threats of danger to others now are more of a concern than ever before. Children may make comments that they will kill the teacher or a peer at school. In light of school shootings and other kinds of catastrophes. These oftenly took to a course of action on the schools and refer the child to juvenile mental health services. That is, threats are viewed as signs of danger. Here too, when in doubt, get a professional opinion. A third guideline is to look for unusual, or questionable behaviors and signs that raise questions. Does your child or adolescent engage in endless, repetitive behaviors with toys or objects for hours on end? Do they see things that aren’t there or believe that some spirit is controlling their minds or hearing voices that tell them to do dangerous or harmful things? Many of these behaviors seem to be qualitatively different and clear departures from what one usually sees in the developing child. Are any of these behaviors there? If so they probably want professional help. But, here we have to factor in age. A five year old muttering to himself, and two or three different voices, while playing with soldiers or toy hospital workers is quite normal. Much of early childhood and normal development includes, imaginary play, imaginary friends, dialogues between stuffed animals, and just plain talking to oneself, sometimes in different voices. However, a 12 year old sitting in the same place by herself, muttering in different voices, bears closer attention, especially if it happens more than once. There may be other behaviors that you should worry about such as not making eye contact with you, pushing you away when you are just trying to hold your child and avoiding other children. Trust any suspicions you might have and get an evaluation. A fourth guideline for whether to consider seeking help, is to look for a stark change in behavior. A significant change may occur in any area of life. Look for changes in relation to what your child or adolescent is usually like. Your child will set the benchmark for what is normal for them. So, a sudden and sustained deviation from their normal pattern may be cause for concern. And abrupt change may show up in school performance from doing fine or adequately, to doing very poorly. Struggling with a difficult subject matter or failing one test, are not reasons to seek an opinion from a mental health professional. But if there is a drastic change across all subjects, rather suddenly, then you may want to seek guidance. Other changes in patterns can involve eating or sleeping, or signs of anxiety that weren’t there before. Be alert to a change of behavior that goes on for more than a day or two. And that cannot be explained easily by some event you know about. A fifth guideline is to look for signs of distress. Is your child showing signs of stress that coincide with exposure to some event or stressor? There are two separate considerations here. First, what is going on in the child’s life. And second, what are the child’s reactions to those events. As for what is going on, many events can lead to signs of distress. Prominent examples of stressful events for the child are; a loss of a parent, parent’s separation and divorce, moving to another city, starting a new school and change in the family in some significant way, and of course, natural disasters like hurricanes and floods that lead to a change in living conditions. With any of these, the child may show psychological problems that are marked, but temporary, lasting perhaps up to a few months. These are often referred to as problems of adjustment, and usually pass with time. You probably can tell these reactions by knowing the event and your child. The decision to seek help pertains to the child’s reactions, and one of these reactions continue. Even temporary reaction that will pass, may deserve treatment if the child shows extreme distress. Sometimes it is difficult to tell if the child is having a difficult time. Parents and adults in general, are great at picking up conduct problems oppositional behavior and hyperactivity. But much less able to pick up depression, anxiety and withdrawal. And those may be the reactions to stress. Depression anxiety and withdrawal are more inward focused problems and do not usually result in conflicts or clashes with the environment. This makes them much less obvious than aggression related behaviors. As an example, many children are victims of bullying, either at school or cyber bullying online. Children are greatly distressed by this, yet most parents do not pick up that their child is a victim of bullying, unless there are start change in behavior like the child refused to go to school, or is unusually fearful. Here all you can do is to be sensitive to the signs of being distressed and look for a change from how the child usually is. The common signs of distress would be problems sleeping, nausea, headaches, nightmares, anxiety and more clinginess. Of course if you can discuss possible stresses directly with your child or adolescent, that would be great. Certainly try to get a better understanding of what is happening, and identify whether some action is required on your part in relation to the source of stress. The final guideline I want to mention is if you find the child unmanageable at home, or at school. By unmanageable, I mean all of the usual efforts aren’t working and the child or adolescent is now a bit out of control. He or she may be doing fine at school, but is uncontrollable at home. Perhaps, damaging things, threatening or harming siblings, or parents and completely running the house. Maybe your child has been so out of control that you have taken her to the emergency room, or called the police in a desperate effort to do something to help. You might be surprised at how often emergency room visits are made, and the police are called for unmanageable child behavior. I mentioned that the child may be doing fine at school, but is completely unmanageable at home. The reverse situation comes up too. The child may be doing well at home, but is completely out of control at school. The school will certainly let you know and often demand that the problem be addressed. That problem is likely to be hyperactivity, disruptive, or aggressive behavior, that the teacher sees as interfering with the rest of the class. In addition to not being readily controllable. In any case being out of control and unmanageable, will be good grounds for seeking help. Let me summarize what I have covered. I provided six guidelines to help decide whether seeking professional help for your child is appropriate. Sometimes, they can be difficult to identify, because there is no clear line between temporary behavior and something more enduring. For example, if your child has a nightmare too, or feel stressed or moody for a couple of days, you probably do not need to seek any outside help. Other behaviors and activities such as self injury, and threats to kill oneself or others require immediate attention. These varying criteria for how long should one wait before seeking help introduce doubts about when to contact a professional. Add to that the fact that children and adolescents are changing pretty drastically, as part of normal development. With changes going on, it is more difficult to tell if the problems are something to wait out or to react to. When in doubt, consider erring on the side of seeking help or at least an evaluation, to see if your concerns want intervention. More often than that, people delay way too long before getting into treatment. Needless to say, it is important to protect your child and perhaps others as well, and to get her back on track in everyday life as quickly as possible. The default position for many people is just letting things go with the hope that they’ll get better. I encourage you to avoid waiting to get out and get the problem checked out to see what if anything is needed. In a separate lesson, I discussed the topic of getting professional help, what to look for and key questions to ask to be sure you are getting the best treatment.


JavaScript Top 10 Articles For the Past Month (v.Sep 2017)

$
0
0

JavaScript Top 10 Articles For the Past Month (v.Sep 2017)

For the past month, we’ve ranked nearly 1,600 JavaScript articles to pick the Top 10 stories that can help advance your career. (0.6% chance to be picked in the list)

  • Topics in this list: Async/Await, Interview, Machine Learning, V8 Engine, Concurrent, Spreadsheet, Progressive Web App
  • Open source of the month is included at the end.
  • Top 10 for React, Node, Machine Learning are posted separately in the publication

Mybridge AI ranks articles based on the quality of content measured by our machine and a variety of human factors including engagement and popularity. This is a competitive list and you’ll find the experience and techniques shared by the experienced JS Developers particularly useful.

Rank 1

What the Fu*k JavaScript: A list of funny and tricky JavaScript examples [9,146 stars on Github]. Courtesy of Denys Dovhan


Rank 2

How we built our first full-stack JavaScript web app in three weeks. Courtesy of Sophia Ciocca


Rank 3

How JavaScript works [Part I]: inside the V8 engine + 5 tips on how to write optimized code. Courtesy of Alexander Zlatkov

…….. [ Part II ]


Rank 4

How to create a Neural Network in JavaScript in only 30 lines of code. Courtesy of Per Harald Borgen and freeCodeCamp


Rank 5

10 JavaScript concepts you need to know for interviews. Courtesy of Arnav Aggarwal


Rank 6

Concurrent JavaScript: It can work! Courtesy of Filip Jerzy Pizło


Rank 7

How I rediscovered my love for JavaScript after throwing 90% of it in the trash. Courtesy of Joel Thoms and Hackernoon


Rank 8

Async/Await Will Make Your Code Simpler. Courtesy of Patrick Triest


Rank 9

Understanding V8’s Bytecode. Courtesy of Franziska Hinkelmann, Ph.D Software Engineer at Google



React.JS Top 10 Articles For the Past Month (v.Sep 2017)

$
0
0

React.JS Top 10 Articles For the Past Month (v.Sep 2017)

For the past month, we’ve ranked nearly 1,500 React articles to pick the Top 10 stories that can help advance your career. (0.7% chance to be picked in the list)

  • Topics in this list: Real Combat Game, D3, Drag and Drop, React Router 4, Higher Order Component, Animation, React Rally 2017
  • Open source of the month is included at the end.
  • Top 10 for JavaScript, Node, Angular are posted separately in the publication

Mybridge AI ranks articles based on the quality of content measured by our machine and a variety of human factors including engagement and popularity. This is a competitive list and you’ll find the experience and techniques shared by the React leaders useful.

Rank 1

All the fundamental React.js concepts, jammed into this single Medium article. Courtesy of Samer Buna and freeCodeCamp


Rank 2

Rethinking drag and drop: Taking something basic and making it beautiful. Courtesy of Alex Reardon


Rank 3

8 things to learn in React before using Redux. Courtesy of Robin Wieruch


Rank 4

All About React Router 4. Courtesy of Brad Westfall



Rank 6

Higher-Order Components (HOCs) for Beginners. Courtesy of Brandon Newton


Rank 7

Real Combat with React, ES6 and Three r86. Courtesy of Project GoldScript


Rank 8

D3 & React at ReactRally 2017. Courtesy of Shirley Wu

………. [ Video ]


Rank 9

React Animations in Depth. Courtesy of Nader Dabit



Vue.JS Top 10 Articles For the Past Month (v.Sep 2017)

$
0
0

Vue.JS Top 10 Articles For the Past Month (v.Sep 2017)

This is our 1st Top 10 series for Vue.JS

For the past month, we’ve ranked nearly 750 Vue articles to pick the Top 10 stories that can help advance your career. (1.3% chance to be picked in the list)

  • Topics in this list: Moved from Angular, Comparison with React, State of Vue, Unit Test with Jest, Nuxt.js, Brunch, Webpack, Chart, Reactivity, VueNYC, VueConf 2017
  • Open source of the month is included at the end.
  • Top 10 for JavaScript, React, Node are posted separately in the publication

Mybridge AI ranks articles based on the quality of content measured by our machine and a variety of human factors including engagement and popularity. This is a competitive list and you’ll find the experience and techniques shared by the Vue.JS leaders useful.

Rank 1

Why we moved from Angular 2 to Vue.js (and why we didn’t choose React). Courtesy of Rever Score


Rank 2

Vue.js: the Progressive Framework, @ VueNYC. Courtesy of Evan You, the Creator of Vue.js

………. [ State of Vue — Evan You at VueConf 2017 ]


Rank 3

Angular vs. React vs. Vue: A 2017 comparison. Courtesy of Jens Neuhaus


Rank 4

Reactivity In Vue.js (And Its Pitfalls). Courtesy of Anthony Gore


Rank 5

Build a Cryptocurrency Comparison Site with Vue.js. Courtesy of Randall Degges and Scotch Development


Rank 6

Write the first Vue.js Component Unit Test in Jest [Series]. Courtesy of Alex Jover Morales


Rank 7

Vue.js + Brunch: The Webpack Alternative You’ve Been Hungry For.


Rank 8

Nuxt.js: A Universal Vue.js Application Framework. Olayinka Omole and SitePoint


Rank 9

Vue.js components: an interactive guide. Courtesy of Per Harald Borgenand freeCodeCamp



My Development Toolset for React Native iOS Development

$
0
0

Hello guys! I would like to introduce my latest choices for React Native iOS Development tools, playlist, service, testing, libraries and websites that I am currently using and learning on MacBook Pro 2015 and 2011.

Update: August 17 2017.

Tools

There are a few different development environments DECO and EXPO or you can use Nuclide by Atom. I use EXPO XDE right now. Don’t use DECO guys. Becuse After delete DECO from your machine, DECO still keeps 800MB. I don’t know why?

Snowflake , Pepperoni and Ignite are React Native starter kits for iOS.

f8App provides tutorials to help get started to use React Native.

React Developer Tools for Chrome Extension.

Playground for React Native Expo Sketch or Fil. If you need local playground, you can use React Native Storybook.

CodePush is another life saver. This tool is a cloud service that deploys mobile app updates directly to their users’ devices.

Npm desktop manager helps to add, remove, update global and local packages with ease.

Sentry is a cross-platform crash reporting and aggregation platform.

ESLint and Flow will help you for writing more quality and correct code.

DevTools for Redux helps with hot reloading, action replay and customizable UI.

Libraries

NativeBase is an essential cross-platform UI component for React Native. We can change the look of our application from one file instead of every component.

MobX is a state management library similar to Redux which is the current defacto state management library. However, MobX is as simple as possible.

A React Native Apple HealthKit is a bridge module for interacting with Apple HealthKit data.

Styled Component is a visual primitive for the component age.

React Color is a collection of Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter, Material Design & more.

Native Navigation , React Native Router Flux or Vix react native navigation use for transition between pages.

Axios uses to Http Request.

Redux state management library – They are a power couple with React. Check out this awesome redux repo and playground ( redux works directly ) area.

Vector Icons provide buttons, logos,navbars and tab bars. Easy to extend, style and integrate into your project.

tcomb form native generate a form based on domain model.

React Native Elements is a solid option that offers everything you need UI Toolkit. But the question is why? Because you can build your own components.

Lottie renders Adobe After Effects animations in iOS app. The diffrence of Lottie loads the animation data in JSON format and renders the animation in real time. Check out free files.

Testing

Jest is a painless React Native testing library.

Jasmine is going to get all kinds of testing under the hood.

Backend

If you have React experience you can build your own back-end with mern.io. Mern is built on Mongo, Express, React and Node. But If you have Angular experience mean.io is better solution for you. If you have none of those experience, Meteor’s a good option for you.

Websites

You can find incredible ReactNative Examples here React.Rocks

React Native github page website .

Made with React is a collection of websites and applications using React Native.

Start React is a library of free to download React.js themes and templates.

ReactEx UI components from around the web, delivered to your inbox.

I share my favorite React Native web site.

Very good React Native Newsletter.

Facebook React Native page.

A guide and reference to help people get started with React Native –ReactNativeExpress.

Don’t catch this guy. This guy has spent building a whole bunch of applications that we know. For example Pokemon, Twitter, AirBnb, Tinder, WhatsApp, Snapchat.

Playlist

React Conf 2017

React Native Tutorial — Build Apps With React Native

Service

React Native wrapper for SegmentIO’s Analytics SDK.

React Native wrapper for Intercom.io is a messaging platform that helps create relation with consumers.

Testfairy , HockeyApp , BuddybuildApplivery are beta testing tools for React Native. My favorite is Buddybuild.

Terms

  • Components: Components are the composable building blocks to your react native application.
  • JSX: JSX is a syntax for embedding XML within JS.
  • Component Lifecycle: The lifecycle helps manage the complexity of different platform APIs
  • Props: Props are way of passing data from parent to child
  • State: State is how a component’s data looks at a given point in time


unable to load script from assets index.android.bundle on windows

$
0
0

I’ve encountered the same issue while following the React Native tutorial (developing on Linux and targeting Android).

This issue helped me resolve the problem in following steps.

  1. (in project directory) mkdir android/app/src/main/assets
  2. react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
  3. react-native run-android

You can automate the above steps by placing them in scripts part of package.json like this:

"android-linux": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android"

Then you can just execute npm run android-linux from your command line every time.

https://stackoverflow.com/questions/44446523/unable-to-load-script-from-assets-index-android-bundle-on-windows


Angular Top 10 Articles For the Past Month (v.Sep 2017)

$
0
0

Angular Top 10 Articles For the Past Month (v.Sep 2017)

From “July” to early September, we ranked nearly 1,400 Angular articles to pick the Top 10 stories that can help advance your career. (0.7% chance to be picked in the list)

  • Topics in this list: Framework Comparison, TypeScript, NgRX, Animation, Tab Component, Lazy Loading, Router Navigation, Mistakes, Ng-template, Testing
  • Open source of the month is included at the end.
  • Top 10 for Vue, React, Node, JavaScript are posted in the publication

Mybridge AI ranks articles based on the quality of content measured by our machine and a variety of human factors including engagement and popularity. This is a competitive list and you’ll find the experience and techniques shared by the experienced Angular developers particularly useful.

Rank 1

Angular vs. React vs. Vue: A 2017 comparison. Courtesy of Jens Neuhaus


Rank 2

NgRx: Patterns and Techniques. Courtesy of Victor Savkin

……….. [ NgRx 4 – Manage State in Angular Applications ]

……….. [ RxJS Marbles – Testing Race Conditions ]


Rank 3

A web animations deep dive with Angular. Courtesy of Dominic Elm


Rank 4

Create a dynamic tab component with Angular. Courtesy of Juri Strumpflohner


Rank 5

10 Ways to Misuse Angular. Courtesy of Philip Da Silva


Rank 6

Building Angular apps at scale. Courtesy of Alex Eagle


Rank 7

Lazy loading: code splitting NgModules with Webpack. Courtesy of Todd Motto


Rank 8

Key Benefits of Angular and TypeScript 10. Courtesy of Dan Wahlin


Rank 9

Angular ng-template, ng-container and ngTemplateOutlet: Guided Tour. Courtesy of Angular University


That’s it for Angular Monthly Top 10. If you like this curation, read best daily articles based on your programming skills on our iOS App.


STM32F030F4P6 Minimum Systerm Board(Cortex-M0)

$
0
0

http://www.hotmcu.com/stm32f030f4p6-minimum-systerm-boardcortexm0-p-208.html

STM32F030F4P6 Minimum Systerm Board(Cortex-M0)

Description

This board is a STM32F030F4P6 Minimum Systerm Board(Cortex-M0). The target MCU is STM32F030F4P6 that is provided by ST. It is a ARM 32-bit Cortex™-M0 CPU, frequency up to 48 MHz, high-speed embedded memories . As a minimal ready-to-run system, this board integrates micorUSB power supply interface, ISP/SWD programming/debugging interface, boot mode selection and so on to take you into the ARMCortex world easiy.

Package list

  • STM32F030F4P6 Minimum Systerm Board(Cortex-M0) x1

    

Document


STM32F103TB ARM Cortex M3 Development Board

$
0
0

Description

HY-TinySTM103T is entry level development board for the ARM Cortex M3 family of devices produced by ST Microelectronics Inc. With HY-TinySTM103T you can explore the features of STM32 family on budget, the board have everything necessary to build simple applications: USB port where power is taken and power supply circuit, reset and oscillator circuits, SWD/ISP for programming and debugging, one status LEDs and reset button.

Although very simple this board will allow you to easily build USB application like PC mouse, USB mass storage device, USB Audio class device, USB to Virtual RS232 port. There are plenty of GPIOs on extension headers where you can connect your additional circuits.

Important, SWD interface subject to schematic, not PCB screen printing. ISP PIN order is GND, SWCLK, SWDIO, UART1-RX, UART1-TX, 3.3V.

Features

  • CPU: STM32F103TBU6 ARM 32 bit Cortex-M3
  • On-Chip Memory: 128KB Flash & 20KB RAM
  • 12pin FPC connector to LCD modules ( RPI-SPI-32LCD & RPI-SPI-28LCD )
  • Micro USB connector
  • ISP button
  • RESET button
  • status LED
  • power supply LED
  • on board voltage regulator 3.3V with up to 300mA current
  • single power supply: takes power from USB port or extension connector pin
  • 8Mhz crystal oscillator
  • extension headers for all microcontrollers pins
  • Dimensions: 31.9 × 21.3mm
  • Distance between the extension connectors: 2.54 mm (1″)

    

Shipping List

  • 1 x HY-TinySTM103T Development Board

Documents


Maple Mini

$
0
0

Maple Mini

This page is a general resource for information specific to the Maple Mini. The Maple Mini is a smaller version of the Maple that fits on a breadboard.

Technical Specifications

Powering the Maple Mini

You can power the Maple Mini via the USB plug or by powering Vin directly.

Warning

The silkscreen on the Maple Mini suggests it will accept an input voltage up to 16 V. We recommend applying no greater than 12 V, and potentially even lower depending upon the current draw requirements of the application. Please seePower Regulation on the Maple Mini for more information.

Power Regulation on the Maple Mini

Power regulation on the Maple is provided by two low dropout linear voltage regulators. (The part is the MCP1703 from Microchip, in the SOT-23A package. You can download the datasheet here ). One of the regulators supplies power to the digital voltage plane; the other supplies power to the analog voltage plane.

These voltage regulators nominally take an input of up to 16V. In addition, while the maximum continuous output current for the board is 250mA, if you are powering the board off higher voltages the amount off current it can supply goes down, due to the regulators needing to dissipate the extra power. So if you are powering the board off 12V, the max current is about 40mA at room temperature. In general (again, at room temperature) the max power dissipation (PD) for the chip is about .37W, and output current = PD/(Vin-Vout). For exact max current calculations, please refer to the datasheet linked above.

If you are planning to draw a lot of current from the Maple board, it is necessary to provide input power as close to 3.3V as possible. Powering the microcontroller circuitry and LEDs on the board alone takes approximately 30mA, so if you are powering the board with 12V that leaves only 10mA (at best) available for powering any user circuitry. Attempting to draw more than 10mA runs the risk of shorting out the power regulators and bricking your board.

GPIO Information

The Maple Mini features 34 total input/output pins, numbered D0 through D33. These numbers correspond to the numeric values next to each header on the Maple Mini’s silkscreen. However, some of them have special uses by default [1].

Pin D23 is the USB D+ line, and D24 is the USB D- line. To use them as GPIOs, your program will need to disable SerialUSB first. Be aware, however, that disabling SerialUSB means that the bootloader won’t work properly, and you’ll need to usePerpetual Bootloader Mode to make your next upload.

Pin D32 is the Mini’s button pin. It is thus mainly useful as an input. The pin will read HIGH when the button is pressed.

Pin D33 is the Mini’s LED pin. It is thus mainly useful as an output. The LED will glow when HIGH is written to it. (It also supports PWM, for finer-grained brightness control).

Master Pin Map

This table shows a summary the available functionality on every GPIO pin, by peripheral type. The “5 V?” column documents whether or not the pin is 5 volt tolerant.

Note that this table is not exhaustive; on some pins, more peripherals are available than are listed here.

Pin GPIO ADC Timer I2C UART SPI 5 V?
D0 PB11 2_SDA 3_RX Yes
D1 PB10 2_SCL 3_TX Yes
D2 PB2 Yes
D3 PB0 CH8 3_CH3
D4 PA7 CH7 3_CH2 1_MOSI
D5 PA6 CH6 3_CH1 1_MISO
D6 PA5 CH5 1_SCK
D7 PA4 CH4 2_CK 1_NSS
D8 PA3 CH3 2_CH4 2_RX
D9 PA2 CH2 2_CH3 2_TX
D10 PA1 CH1 2_CH2 2_RTS
D11 PA0 CH0 2_CH1_ETR 2_CTS
D12 PC15
D13 PC14
D14 PC13
D15 PB7 4_CH2 1_SDA Yes
D16 PB6 4_CH1 2_SCL Yes
D17 PB5 1_SMBA
D18 PB4 Yes
D19 PB3 Yes
D20 PA15 Yes
D21 PA14 Yes
D22 PA13 Yes
D23 PA12 1_ETR 1_RTS Yes
D24 PA11 1_CH4 1_CTS Yes
D25 PA10 1_CH3 1_RX Yes
D26 PA9 1_CH2 1_TX Yes
D27 PA8 1_CH1 1_CK Yes
D28 PB15 2_MOSI Yes
D29 PB14 3_RTS 2_MISO Yes
D30 PB13 3_CTS 2_SCK Yes
D31 PB12 1_BKIN 2_SMBA 3_CK 2_NSS Yes
D32 PB8 4_CH3 Yes
D33 PB1 CH9 3_CH4

GPIO Port Pin Map

The following table shows what pins are associated with each GPIO port.

GPIOA GPIOB GPIOC
PA0: D11 PB0: D3 PC0: –
PA1: D10 PB1: D33 PC1: –
PA2: D9 PB2: D2 PC2: –
PA3: D8 PB3: D19 PC3: –
PA4: D7 PB4: D18 PC4: –
PA5: D6 PB5: D17 PC5: –
PA6: D5 PB6: D16 PC6: –
PA7: D4 PB7: D15 PC7: –
PA8: D27 PB8: D32 PC8: –
PA9: D26 PB9: – PC9: –
PA10: D25 PB10: D1 PC10: –
PA11: D24 PB11: D0 PC11: –
PA12: D23 PB12: D31 PC12: –
PA13: D22 PB13: D30 PC13: D14
PA14: D21 PB14: D29 PC14: D13
PA15: D20 PB15: D28 PC15: D12

Timer Pin Map

The following table shows what pins are associated with a particular timer’s capture/compare channels.

Timer Ch. 1 Ch. 2 Ch. 3 Ch. 4
1 D27 D26 D25 D24
2 D11 D10 D9 D8
3 D5 D4 D3 D33
4 D16 D15 D32

EXTI Line Pin Map

The following table shows which pins connect to which EXTI lines.

EXTI Line Pins
EXTI0 D3, D11
EXTI1 D10, D33
EXTI2 D2, D9
EXTI3 D8, D19
EXTI4 D7, D18
EXTI5 D6, D17
EXTI6 D5, D16
EXTI7 D4, D15
EXTI8 D27, D32
EXTI9 D26
EXTI10 D1, D25
EXTI11 D0, D24
EXTI12 D23, D31
EXTI13 D14, D22, D30
EXTI14 D13, D21, D29
EXTI15 D12, D20, D28

USART Pin Map

The Maple Mini has three serial ports (also known as USARTs). They communicate using the pins given in the following table.

Serial Port TX RX CK CTS RTS
Serial1 D26 D25 D27 D24 D23
Serial2 D9 D8 D7 D11 D10
Serial3 D1 D0 D31 D30 D29

Low-Noise ADC Pins

Maple Mini has an electrically isolated analog power plane with its own regulator, and a geometrically isolated ground plane, connected to the digital plane by an inductor. Its analog input pins, D3 — D11, are laid out to correspond with these analog planes, and our measurements indicate that they generally offer low noise ADC performance. However, analog performance may vary depending upon the activity of the other GPIOs. Consult the Maple Mini hardware design files for more details.

Board-Specific Values

This section lists the Maple Mini’s board-specific values.

  • CYCLES_PER_MICROSECOND: 72
  • BOARD_BUTTON_PIN: 32
  • BOARD_LED_PIN: 33
  • BOARD_NR_GPIO_PINS: 34
  • BOARD_NR_PWM_PINS: 12
  • boardPWMPins: 3, 4, 5, 8, 9, 10, 11, 15, 16, 25, 26, 27
  • BOARD_NR_ADC_PINS: 9
  • boardADCPins: 3, 4, 5, 6, 7, 8, 9, 10, 11
  • BOARD_NR_USED_PINS: 4
  • boardUsedPinsBOARD_LED_PINBOARD_BUTTON_PIN, 23, 24 (23 and 24 are used by USB)
  • BOARD_NR_USARTS: 3
  • BOARD_USART1_TX_PIN: 26
  • BOARD_USART1_RX_PIN: 25
  • BOARD_USART2_TX_PIN: 9
  • BOARD_USART2_RX_PIN: 8
  • BOARD_USART3_TX_PIN: 1
  • BOARD_USART3_RX_PIN: 0
  • BOARD_NR_SPI: 2
  • BOARD_SPI1_NSS_PIN: 7
  • BOARD_SPI1_MOSI_PIN: 4
  • BOARD_SPI1_MISO_PIN: 5
  • BOARD_SPI1_SCK_PIN: 6
  • BOARD_SPI2_NSS_PIN: 31
  • BOARD_SPI2_MOSI_PIN: 28
  • BOARD_SPI2_MISO_PIN: 29
  • BOARD_SPI2_SCK_PIN: 30
  • BOARD_JTMS_SWDIO_PIN: 22
  • BOARD_JTCK_SWCLK_PIN: 21
  • BOARD_JTDI_PIN: 20
  • BOARD_JTDO_PIN: 19
  • BOARD_NJTRST_PIN: 18

Hardware Design Files

The hardware schematics and board layout files are available in the Maple Mini GitHub repository.

From the GitHub repository main page, you can download the entire repository by clicking the “Download” button. If you are familiar with Git, you can also clone the repository at the command line with

$ git clone git://github.com/leaflabs/maplemini.git

Failure Modes

The following known failure modes apply to all Maple boards. The failure modes aren’t design errors, but are easy ways to break or damage your board permanently.

  • High voltage on non-tolerant pins: not all header pins are 5 V compatible; so e.g. connecting certain serial devices in the wrong way could over-voltage the pins. The pin-mapping master table details which pins are 5 V-tolerant.

Errata

This section lists known issues and warnings for the Maple Mini Rev 2 (the first Rev sold to the public).

  • Silkscreen Vin voltage mistake: The silkscreen on the Maple Mini falsely indicates that Vin may be supplied with up to 16V. We recommend an input voltage no greater than 12V, and potentially even lower depending upon the current draw requirements of the application. Please see Power Regulation on the Maple Mini for more information.

CZ miniSTM32F103V -EK

$
0
0

CZ miniSTM32F103V -EK

CZ miniSTM32F103V_-EK

Name

CZ miniSTM32F103V_-EK

Specs

512kb Flash, 64kB RAM, 2 × 12-bit D/A converters 112 fast I/O ports 2 × I2C 5 USARTs 3 SPIs (18 Mbit/s), 2 with I2S interface multiplexed 32 kHz oscillator for RTC with calibration Supports Compact Flash, SRAM, PSRAM, NOR and NAND memories

Board features

all pin holders / rows already soldered Boot0 and Boot1 jumper jumpers (RX,TX) for the USB-Serial converter 2x USB one with CH340 RS232-USB-converter chip (“Serial1”) 32.768kHz and 8Mhz oscillators on board CR1220 battery holder reset button Two user buttons: PD12, PC0 Two controllable LED; PE5, PE6 power indicator LED; JTAG / SWD 20 -pin standard interface ; 32 foot FSMC TFT LCD screen interface Board size : 101.5 mm x 76.68 mm

additional chips (already soldered) SPI flash W25q16 (on SPI1: CS: PA4, MISO: PA6, MOSI: PA7, SCK: PA5) EEPROM 24C02 (on I2C1: SCL: PB6, SDA: PB7 both with 4.7K pullup) IC Adress: 0x00 ( A0=A1=A2=GND) space holder for 485 IC (PA3, PA0, PA2) and DS18B20 (Data: PB14)

Known issues

  • None

Schematic

Media:Cz_ministm32f103v-ek_schematic.pdf

Forum link

http://www.stm32duino.com/viewtopic.php?f=28&t=490


Review of Wio Tracker with GPS, Bluetooth 3.0 and GSM Connectivity

$
0
0

Wio GPS – also called Wio Tracker – is an Arduino compatible board based on Microchip Atmel SAMD21 MCU with GPS, Bluetooth, GSM/GPRS connectivity, as well as several Grove connectors to connect sensors and modules for your IoT project. SeeedStudio sent me a sample for evaluation, so I’ve tested it, and reported my experience below by testing some of the Arduino sketches.

Wio Tracker Unboxing

All I got in the package was Wio GPS tracker v1.1 board. The top includes the Atmel MCU, an RGB LED, a microphone and 3.5mm AUX jack to make phone calls, a user and power button, a micro USB port for power and programming, a small 2-pin connector for a battery, and 6 Grove connectors for digital, serial, I2C and analog modules.

The other side of the board comes with Quectel MC20 module that handles Bluetooth, GPS and GSM, a dual use micro SD card and nano SIM slot, and the GPS, 2G, and Bluetooth antennas. We can also see -/+ footprints close to connect speakers close to the OSHW logo.

Getting Started with Wio GPS Tracker with Arduino IDE

I’ve been following Wio GPS Board Wiki for this part of the review, and as we’ll soon discovered I’ve had a rather mixed experience.

First, you’ll need a micro USB to USB cable to connect the board to Windows/Linux/Mac computer. This is the kernel output I got from Ubuntu 16.04:

After installing Arduino IDE for your operating system, we can add Seeduino boards to the IDE, by going to File->Preferences and pasting the link https://raw.githubusercontent.com/Seeed-Studio/Seeed_Platform/master/package_seeeduino_boards_index.json into Additional Boards Manager URL field, and clicking OK.Now go to Tools->Boards->Boards Manager search for wio, and install Seeduino SAMD by Seeed Studio.

You can also install Adafruit Neopixel by going to to Sketch->Manage Libraries->Include Library, or importing the zip file. After that point, I decided to check whether I could find “Wio Tracker” in the list of boards as indicated in the Wiki, but there was no such board so I selected Wio GPS Board, and selected port /dev/ttyACM0 (Wio GPS Board) port.

Then I went to check for sample sketches, and found some in Examples->Seeed_Wio_GPS_Board for the all key features of the board. So I tried a bunch of them including RGB_LED, Bluetooth, GNSS (GPS), and GSM (Send SMS), and only the Bluetooth sample would work.

By I went back to the Wiki, and found out I add to import Wio Tracker library too, which I did, and I had another very similar sets of samples for MC20_GPS_Traker-master.

I’m not exactly sure we have two separate sets of nearly identical samples, but let’s see if I have more like with samples in MC20_GPS_Tracker-master folder.

Blink.ino is supposed to blink the RGB using blue color:

I could upload the program to the board with the following warning messages:

The RGB LED did not work. So I tried to remove Adafruit Neopixel library, same results. Finally I checked schematics to confirm the RGB LED is indeed connected to D10, and inserted some println debug code to make sure the program is running properly. Everything seems right, but the RGB LED would not blink. I’ve contacted the company, but unsurprinsgly they don’t work during the week-end.

Let’s move on with BT_CLientHandle.ino sketch that should allow us to pair the board with your phone. The code is relatively simple for this task:

I could see QUECTEL-BT with my Android phone, and had no problem to pair the board.

The serial output with pairing, and disconnecting events shows some of the AT commands used:

I also tried to connect a speaker to the AUX port of the board to see if I could use it as Bluetooth speaker, but it did not work, so some more code and a different Bluetooth audio profile (not HF_PROFILE) are likely required. All I could hear was dial-up modem sounds from the speakers. But still, we can tick this Bluetooth test as success.

Time for a GPS test. GNSS_Show_Coordinate.ino sketch is supposed to  output latitude and longitude to the serial console, and again the code to achieve this is still fairly simple:

But all I got in the serial output was the following:

With +CREG: 0,0 shown over and over. We can find the different AT Command sets (and EAGLE schematics) in the resources directory in Github. One of the document reports that AT+CREG? is a read command to retrieve network registration status, and the two numbers referred as <n> and <stat> are set to 0,0 meaning that:

  1. Disable network registration unsolicited result code
  2. Not registered, ME is not currently searching a new network to register on

I firstly did the test indoors, and although previously I could get a signal indoors with NavSpark mini board, I still went outside in case it was a signal problem, but the result was just the same. So maybe the program is stuck somewhere because I had not inserted a SIM card yet. Since I was not sure whether my operator still supported 2G, I forced my Android phone to use 2G, and the phone did get a signal using “E” instead of the usual 3G, and I could send an SMS and make a phone call over 2G network (I think).

So I took out the SIM card from my phone, and …. I could not insert right away simply because my SIM card was cut out as a micro SIM, but the board requires a nano SIM. Luckily, I purchased nano/micro SIM card adapters a while ago as I knew sooner or later I would have this little first world problem. You can find those for less than $1 on eBay, so even if you don’t need them right now, it might be a good idea to get some.

Once I cut out my SIM card so that it fits into the micro SIM to nano SIM adapter that I will need to use when I put back the SIM card into my smartphone, I inserted  the nano SIM and a micro SD card at the same time, as the picture below shows with the white band right above the 4GB micro SD card being the nano SIM card. I did not know they made those, as I’ve only seen shared slots in the past.

I reran the GPS sample program, and the serial output changes a bit, but still no longitude and latitude info:

+QGNSSC:1 means the GNSS module is powered on so that’s good news I guess.

+CREG: 0,2 means the SIM card is registered, and in home network, but then it will switch to +CREG:0,5 meaning the SIM card is registered and roaming. Not really re-assuring.

They also have a more complex sample called GNSS_Google_KML.ino, that will get coordinate display them in OLED display attached to the board, and save data into a gps.txt into the SD card with raw longitude and latitude data that can be inserted into a Google KML file. A GoogleMapDemo.ino sketch will upload your coordinates to ziladuo.com website. That’s provided it works of course… and considering the simplest sample GNSS would not work. I gave up on GPS/GNSS tests.

Last try was with the GSM function with the send SMS sample (MC20_SMSSend.ino) that will send “Hello MC20!!” message to the phone number of your choice”. Again it’s very easy to program:

But sadly I could not send an SMS, as the function waitForNetworkRegister failed:

I had to end my testing there. I could not remove the nano SIM card with my hands, and I had to use a pair  tweezers to get it out by pushing those the small holes on top of the slot mechanism.

So overall my experience with the board was quite catastrophic with only Bluetooth working,  and GPS, 2G GSM, and even the RGB LED sample all failing. I also often had trouble uploading the code to the board with messages like:

or (even after having close to the serial terminal for a while):

So I often had to re-try and re-try to successfully upload the code to the board. I’m sure there must be an explanation for all the issues I had. I can see they tested it in Windows, but I’m using Ubuntu 16.04, so maybe that could be one reason?

Having said that, if the board actually worked, I really like what SeeedStudio has done, as it looks really easy to program the board with GPS, Bluetooth, or 2G data, SMS, calls, and you can add Grove Sensors to make pretty more advanced IoT projects. The company also provides a more practical sample with their “Wild Adventure Tracker” demo reporting sending GPS coordinates over SMS when a shock occurs. The source code on Github with a video showing the results below.

The company is also working on a 4G version, and I’ll probably have a chance to give it another try once it is released. If you are interested in Wio GPS Tracker board, you can pre-order it for $24.95 including all three antennas.



Swift Top 10 Articles For the Past Month (v.Sep 2017)

$
0
0

Swift Top 10 Articles For the Past Month (v.Sep 2017)

For the past month, we’ve ranked nearly 1,000 Swift articles to pick the Top 10 stories that can help advance your iOS career (1% chance to be picked in the list)

  • Topics in this list: iPhone X, Table Views, Neural Networks, Snapshot Testing, Debugging, Animation, Core Data, Architecture
  • Swift Open Source of the Month is included at the bottom.

Mybridge AI ranks articles based on the quality of content measured by our machine and a variety of human factors including engagement and popularity. This is a competitive list and you’ll find the experience and techniques shared by iOS leaders particularly useful.

Rank 1

Dealing with Complex Table Views in iOS and Keeping Your Sanity [Trending in September]. Courtesy of Marin Benčević


Rank 2

iPhone X: Dealing with Home Indicator. Courtesy of Jordan Morgan, iOS Developer at Buffer


Rank 3

Managing different environments in your Swift project with ease. Courtesy of Yuri Chukhlib


Rank 4

Deep Neural Networks in Swift, lessons learned. Courtesy of Jeremi Kaczmarczyk and Tooploox


Rank 5

Debugging Swift code with LLDB. Courtesy of Ahmed Sulaiman


Rank 6

Snapshot Testing in Swift. Courtesy of Stephen Celis


Rank 7

iOS: Animate TableView Updates. Courtesy of Stan Ostrovskiy


Rank 8

Cracking the Tests for Core Data. Courtesy of S.T.Huang Brewery


Rank 9

Generics in Swift 4. Courtesy of Candost Dağdeviren



Guide to installing Arduino on Ubuntu Virtualbox Guest under Windows Host

$
0
0

Guide to installing Arduino on Ubuntu Virtualbox Guest under Windows Host

If you are the proud owner of an Arduino Uno board but prefer to work in an Ubuntu VM instead of dual-booting, this article is for you. I’ll guide you through configuring VirtualBox under your Windows host to get Arduino working properly.

Installing required programs

Before we worry about USB ports/serials/whatever, let’s just install the stuff we’ll need on our Ubuntu guest.

Installing Python 2.7 and pip

This installation requires Python 2.7 and pip. Read through my tutorial on installing both.

Installing the Arduino IDE distribution

Assuming the Ubuntu version on your VM is never than Ubuntu 10.10 (Maverick), simply

$ sudo apt-get install arduino

Otherwise, consult the official documentation

Installing picocom

picocom is a “minimal dumb-terminal emulation program”, and we’ll be using it for serial communication. Installation is done through apt-get.

$ sudo apt-get install picocom

Installing ino

Instead of using the Arduino GUI, we’re going to use ino. ino allows us to compile and upload arduino projects from the command line, enabling us to use our favorite text editors such as VIM or emacs.

To install ino,

$ sudo pip install ino

Installing the drivers

Follow the instructions on getting the Arduino Development Environment for your Windows host.

NOTE: On step 4, “Install the Drivers”, it says

Finally, navigate to and select the Uno’s driver file, named “ArduinoUNO.inf”, located in the “Drivers” folder of the Arduino

What I had to do was just select the folder C:\path\where\I\extracted\arduino\drivers, I did not select an individual file.

Verifying the Windows Installation

Verify the Windows installation worked by getting the Blink program to work on your Arduino board. First, make sure your Arduino board is plugged in. Now Open up the arduino executable on your Windows machine. This will bring up a tiny, blue-green text editor. In the editor, navigate to File ⇒ Examples ⇒ 01.Basics ⇒ Blink. Click the Upload button (to the right of the Check mark), press the reset button on your Arduino board, and see if the LED on your board blinks in a rhythmic fashion.

If everything looks good, it’s time to proceed to the next step. Otherwise, it’s time to start Googling 😦

Configuring VirtualBox

We now need to help facilitate communication between our Ubuntu VM and our Windows Host. You might be wondering why we don’t just attach the USB device from VirtualBoxes Devices ⇒ USB Devices menu. The reason is because the extra USB virtualization introduces enough latency to make uploading fail sporadically on our VM. The solution is to forward serial ports for more direct communication with the host.

Getting the port number

First, we need to get the port number associated with our Arduino bored. To do so, we need to open the Device Manager within Windows. We can accomplish this by opening the Start Menu, and typing “Device Manager” in the “Search programs and files” box that will probably already have a blinking text cursor in it. Click the top result, which should just read “Device Manager”

Look for the “Ports (COM & LPT)” section. Click the + sign to expand it, and you should see “Arduino Uno (COM#)” where # is some number. In my case, it was 3.

This number is very important, so I’ll refer to this particular number as # for the upcoming section.

Configuring ports in VirtualBox

Shutdown your VM if you still have it open. Don’t save the state – completely shut it down.

Now navigate to VirtualBox, select the VM you plan on working with, and then click settings. Select the “Serial Ports” option on the left hand side.

Click the “Port 1” tab, and then select “Enable Serial Port”. Regardless of what # from earlier was, the Port Number should be set to COM1. This tells VirtualBox to have the Arduino board mounted at /dev/ttyS0. For the Port Mode, select “Host Device”. For “Port/File Path:”, Enter in COM#:. The colon needs to be there.

That’s it for configuring VirtualBox. Start your VM back up, and we’ll wrap up this installation with testing and configuring ino.

Testing, Using, and Configuring ino

A majority of this information is taken straight from the ino quickstart quide.

Make a directory you would like to store your arduino projects in, and cd to it.

$ mkdir ~/arduino
$ cd ~/arduino

Now make a testproject directory and cd to it.

$ mkdir testproject
$ cd testproject

Now we initialize an arduino project.

$ ino init

If you look at the contents of your testproject directory, you should see a lib and a src directory. Within src, there will be a file called sketch.ino. Clear out the file and paste in the following, which will make the LED on the arduino blink very rapidly.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#define LED_PIN 13

void setup()
{
    pinMode(LED_PIN, OUTPUT);
}

void loop()
{
    digitalWrite(LED_PIN, HIGH);
    delay(100);
    digitalWrite(LED_PIN, LOW);
    delay(100);
}

raw source

Now make sure you are in the project’s root directory, and then run the build process. This will compile your program.

$ cd ~/arduino/testproject
$ ino build

If the build succeeds, we can now upload to our Arduino!

$ ino upload -p /dev/ttyS0

Upon successful upload, we should see the following

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file ".build/uno/firmware.hex"
avrdude: writing flash (1034 bytes):

Writing | ################################################## | 100% 0.67s

avrdude: 1034 bytes of flash written
avrdude: verifying flash memory against .build/uno/firmware.hex:
avrdude: load data flash data from input file .build/uno/firmware.hex:
avrdude: input file .build/uno/firmware.hex contains 1034 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.20s

avrdude: verifying ...
avrdude: 1034 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Permissions Issues

Remember that /dev/ttyS0 represents our Arduino, and we specified that specific location by selecting the Port Number as COM1 in the VirtualBox settings. There’s a pretty high chance you receive the following error upon your first upload attempt:

~/arduino/testproject$ ino upload -p /dev/ttyS0
/bin/stty: /dev/ttyS0: Permission denied
stty failed

If that’s the case, follow these instructions. Otherwise, skip to the .inorc section.

First, we need to figure out what group is associated with this port.

$ ls -al /dev/ttyS0

The output I received from the command was

crw------- 1 root dialout 4, 64 May  7 04:34 /dev/ttyS0

Thus the dialout group owns the port, but it’s not even group writable. So we need to add ourselves to the dialout group and then make the port group writable.

$ sudo usermod -a -G dialout YOUR_USER_NAME
$ sudo chmod 660 /dev/ttyS0

NOTE: You will need to log out and log back in before you become a part of the group.

Now go back to the project directory and attempt the upload again

$ cd ~/arduino/testproject
$ ino upload -p /dev/ttyS0

.inorc

Congratulations! You now have your Arduino environment working on your Virtual Machine. There’s only one last detail to take care of. In order to avoid having to pass the port to the $ ino upload command every time, we can create a configuration file that stores our desired port for us. Execute the following:

$ echo -e "serial-port = /dev/ttyS0\n" > ~/.inorc

Examine the contents of ~/.inorc for yourself to make sure the command worked. Now, you should be able to go back to your project and simply run

$ ino upload

without a need to specify the port.


shadowsocks实现原理

$
0
0

shadowsocks实现原理

shadowsocks是目前最好的科学上网方式,它的流量经过加密,所以没有流量特征不会被GFW阻断;关键是,它的实现原理也通俗易懂。

笔者是ss的重度用户,电脑和手机都在使用。本文不会介绍怎么安装使用shadowsocks,因为很多文章都有详细介绍。在文中简称shadowsocks为ss。

前言

shadowsocks已经出现很多年了,作者是clowwindy,大家可以去github查看他的主页。github上ss仓库https://github.com/shadowsocks/shadowsocks/tree/master的代码已经比较难维护了,状态机和epoll很好,提高了程序的性能效率,但是很多东西也影响了我们去看核心的东西是什么。所以本文解析的是一个轻量级的ss,clowwindy写的比较早的版本,那个时候使用select而不是epoll,网络通信的逻辑也很清晰,容易了解ss的原理,代码的仓库为https://github.com/YvesChan/shadowsocks

概述

ss要求本机运行local.py,海外服务器运行server.py。local.py默认监听localhost的1080端口,该端口代理浏览器的请求。browser要访问google时,会和localhost:1080进行一次基于sock5协议的通信,如上图的红色虚线框,sock5协议可以去了解下,维基百科有不错的介绍。

代理的流程如下:

  1. localhost:1080经过sock5协议后,就知道要访问google了
  2. local程序会把流量加密,然后把普通的TCP流量发往海外服务器;
  3. 海外服务器收到请求后,解密得到要访问google
  4. 海外服务器请求google后把得到的数据加密返回给local
  5. local解密返回给browser。

ss的解密和加密基于用户设置的密码,所以local和server之间可以做到加密和解密的一致。

网络编程

python网络编程相比C语言要少很多代码,由于有很多封装得很好的类可以使用,网络编程更加符合思维走向。作者clowwindy使用了SocketServer.TCPServer和SocketServer.StreamRequestHandler两个类完成TCP的处理。在python的官方文档可以查看到两者的详细介绍。从名字中也可以知道两者的作用:TCPServer负责处理连接accept或close等,此类的构造函数要求传入Handler类;Handler类负责连接的数据处理,包括recv和send,此类要求实现handle方法。StreamRequestHandler更进一步把recv和send封装为rfile读端的read和wfile.write,把socket操作转化为了文件的读写,更加便捷。

local程序的handle方法:

图截自github,本人已经标注handle函数每个部分的作用,最后的handle_tcp等待sock和remote的事件,sock可读则读取然后发往remote,remote可读就读取然后发往sock,代码如下图:

注意encrypt和decrypt,加密和解密的算法感兴趣可以去看看代码,使用到了python自带的加密解密方法。

server端的handle方法就不再截图了,因为和local.py很类似,只是一些细节流程不一致而已。大家感兴趣可以下载代码阅读。

运行效果
服务端先运行server.py后,本地运行loca.py,并且设置浏览器代理为本地1080就OK了

总结

ss除了python版本之外还有c和go的版本,后两者的口碑比python版本的好一点。

感谢clowwindy大牛,正是有能力的人的辛勤且无悔的付出,开源领域才越来越繁荣。

最后,我们应该为生活在有github的时代而感到幸福。


BeagleBone Blue and robots that can fly

$
0
0

BeagleBone Blue and robots that can fly

You’ve now built robots that can move around on a wheeled structure, robots that can have legs, and robots that can sail. You can also build robots that can fly, relying on the BeagleBone blue to control their flight. There are several possible ways to incorporate the BeagleBone into a flying robotic project, but perhaps the most straightforward is to add it to a quadcopter project.

Quadcopters are a unique subset of flying platforms that have become very popular in the last few years. They utilize the same vertical lift concept as helicopters; however, they employ not one but four motor or propeller combinations to provide an enhanced level of stability. Here is a picture of just such a platform:

The quadcopter has two sets of counter-rotating propellers, which simply means that two of the propellers rotate one way and the other two rotate the other to provide thrust in the same direction. This provides a platform that is inherently stable. Controlling the thrust on all the four motors allows you to change pitch, roll, and yaw of the device.

Here is a diagram that may be helpful:

As you can see, controlling the relative speeds of the four motors allows you to control the various ways the device can change position. To move forward, or really in any direction, we combine a change in roll or pitch with a change in thrust, so that instead of going up, the device moves forward, as shown in this diagram:

In a perfect world, you might, knowing the components you used to build your quadcopter, know exactly how much control signal to apply to get a certain change in the roll/pitch/yaw or altitude of your quadcopter. But there are simply too many aspects of your device that can vary to know this well enough to rely on a fixed set of signals. Instead, this platform uses a series of measurements of its position, pitch/roll/yaw, and altitude, and then adjusts the control signals to the motors to achieve the desired result. We call this feedback control. Here is a diagram of a feedback system:

As you can see, if your quadcopter is too low, the difference between the Desired Altitude and the Actual Altitude will be positive, and the motor control will be increased, increasing the altitude. If the quadcopter is too high, the difference between the Desired Altitude and the Actual Altitude will be negative, and the Motor Control will be decreased, decreasing the altitude. If the Desired Altitude and the Actual Altitude are equal, then the difference between the two will be zero, and the Motor Control will be held at its current value. Thus, the system stabilizes even if the components aren’t perfect, or if wind comes along and blows the quadcopter up or down.

One application of the BeagleBone Blue in this type of robotic project is to actually coordinate the measurement and control of the quadcopter’s pitch, roll, yaw, and altitude. This can be done but it is a very complex task and the detail of its implementation is beyond the scope of this book. There are some individuals in the open source software and hardware space working on this problem. See https://diydrones.com/profiles/blogs/beaglebone-blue-released-linux-enabled-autopilot-for-80?xg_source=activity for details.

The BeagleBone Blue can still be utilized in this type of robotic projects, without focusing on the low-level control, by introducing another embedded processor to do the low-level control, and using the BeagleBone blue to manage the high level tasks, such as using the vision system of the BeagleBone Blue to identify a colored ball and then guiding the platform toward it. Or, as in the sail boat example, using the BeagleBone to coordinate GPS tracking and long-range communications via ZigBee. This is the type of example that I’ll cover in this section.

The first thing you’ll need is a quadcopter. There are three approaches to this: one, purchase an already assembled quadcopter; two, purchase a kit and construct it yourself; or three, buy the parts and construct the quadcopter. In either case, to complete this section, you’ll need to choose one that uses the ArduPilot as its flight control system. This flight system uses a flight version of the Arduino to do the low level feedback control we talked about earlier. The advantage to this system is that you can talk to the flight control system via USB.

There are a number of assembled quadcopters available that use this flight controller. One place to start is at ardupilot.com. This will give you some information on the flight controller, and the store has several already assembled quadcopters. If you think assembling a kit is the right approach, try www.unmannedtechshop.co.uk/multi-rotor.htmlor www.buildyourowndrone.co.uk/ArduCopter-Kits-s/33.htm, as each of these not only sells assembled quadcopters but kits as well.

If you’d like to assemble your own kit, there are several good tutorials about choosing all the right parts and assembling your quadcopter. Try blog.tkjelectronics.dk/2012/03/quadcopters-how-to-get-startedblog.oscarliang.net/build-a-quadcopter-beginners-tutorial-1/, or http://www.arducopter.co.uk/what-do-i-need.html for excellent instructions.

You might be tempted to purchase one of the very inexpensive quadcopters that are being offered on the market. For this project, you will need two key characteristics of the quadcopter. First, the quadcopter flight control will need a USB port so you can connect the BeagleBone Blue to it. Second, it will need to be large enough with enough thrust to carry the extra weight of the BeagleBone Blue, a battery, and perhaps a web cam or other sensing device.

No matter which path you choose, another excellent source for information is code.google.com/p/arducopter. This gives you some information on how the ArduPilot works, and also talks about Mission Planner, the open-source control SW that will be used to control the ArduPilot on your quadcopter. This SW runs on the PC and communicates to the quadcopter in one of two ways: either directly through a USB connection or through a radio connection. It is the USB connection that you will communicate between the BeagleBone Blue and the ArduPilot.

The first step, when working in this space, is to build your quadcopter and get it working with an RC radio. When you allow the BeagleBone Blue to control it later, you may still want to have the RC radio handy, just in case things don’t go quite as planned.

When the quadcopter is flying well, based on your ability to control it using the RC radio, then you should begin to use the ArduPilot in autopilot mode. To do this, download the SW from ardupilot.com/downloads. You can then run the SW and you should see something like this:

You can then connect your ArduPilot to the SW and press the connect button in the upper right corner. I will not walk you through how to use the SW to plan an automated flight plan as there is plenty of documentation for that on the ardupilot.com website. What you want to do is to hook up your BeagleBone Blue to the ArduPilot on your quadcopter so that it can control the flight of your quadcopter much as the Mission Planner does, but at a much lower and more specific level. You will use the USB interface, just as the Mission Planner does.

To connect the two devices, you’ll need to modify the Arduino code and create some BeagleBone Blue code, then simply connect the USB interface of the BeagleBone Blue to the Ardupilot and you can issue yaw, pitch, and roll commands to the Arduino to guide your quadcopter to wherever you want it to go. The Arduino will take care of keeping the quadcopter stable. An excellent tutorial on how to accomplish, albeit using the Raspberry Pi as the controller, is available at http://oweng.myweb.port.ac.uk/build-your-own-quadcopter-autopilot/.

Now that you can fly your quadcopter using the BeagleBone Blue, you can use the same GPS and ZigBee capabilities, mentioned in other areas of the book, to make your quadcopter semi-autonomous.

Your quadcopter can also act completely autonomously as well. Adding a 3G modem to the project allows you to track your quadcopter, no matter where it goes, as long as it can receive a cell signal. Here is a picture of such a modem:

This can be purchased on amazon.com, but also at your cellular service provider. Once you have purchased your modem, simply google instructions on how to configure it in Linux. An example project is given at http://www.adafruit.com/blog/2013/08/23/sky-drone-fpv-uses-3g4g-cell-network-to-provide-long-range-rc/.


LoRaWAN Part 1: How to Get 15 km Wireless and 10-Year Battery Life for IoT

$
0
0

LoRaWAN Part 1: How to Get 15 km Wireless and 10-Year Battery Life for IoT

Contributed By Digi-Key’s North American Editors

Editor’s note: In Part 1 of this two-part series, we will discuss the issue of long-range, low-power communication for IoT and how to achieve it, securely. In Part 2, LoRaWAN Part 2: How to Use Microchip’s Modules to Speed IoT Design, we will discuss an implementation using off-the-shelf LoRaWAN hardware and software.

Low-power wireless networks are a key enabler for the Internet of Things (IoT), but familiar options such as Bluetooth, ZigBee, Wi-Fi, or cellular, lack an acceptable combination of extended range and battery life. To address this, new sub-GHz specifications are being offered, one of which is LoRaWAN.

LoRaWAN can achieve a 15 km range at power consumption levels low enough to enable 10-year battery life. Further, the availability of an off-the-shelf development kit lets designers quickly bring up a complete LoRaWAN network application with minimal effort.

This article will look at the advantages of sub-GHz communication, examine the important role of modulation schemes, and introduce LoRaWAN with a description of its physical and media access control layers, as well as its security features. It will conclude with a brief introduction to the RN2903 LoRaWAN module from Microchip Technology.

Sub-GHz advantages

High-frequency connectivity options provide high data rates but have limited range at acceptable power levels. For power-constrained designs that need extended range, low-frequency operation is a preferred approach. The lower the frequency, the less power is required to maintain a particular link budget at a specified range, as shown by the Friis transmission equation:

Equation 1

Where:

Pt = transmitted power

Pr = received power

Gt = transmitter antenna gain

Gr = receiver antenna gain

λ = wavelength

d = distance between transmitter and receiver

Lower frequency transmissions typically translate to lower data rates, but IoT applications rarely present significant throughput requirements. Additionally, lower data rates bring another advantage in the form of reduced error rates, thereby decreasing the sensitivity requirements of the receiver.

The downside is that with slow links the duty-cycle increases, thereby increasing the chance of error due to interference from noise and other signals. Further, the longer the time required to transmit a message means increased power consumption at both the transmitter and receiver ends.

That said, sub-GHz communications can help meet the requirements for range, power, and data rate required by most IoT applications. Still, the choice of modulation method used for data encoding adds a further layer affecting these three key parameters.

Modulation methods

Communications specialists have for years relied on spread spectrum modulation techniques to enhance immunity to noise or interfering signals. Channel coding methods used in spread spectrum techniques, such as direct-sequence spread spectrum (DSSS), are able to reduce transmitter power requirements by building redundancy into the spreading algorithm.

Although this approach can support very high data rates, it requires a high bandwidth carrier and sophisticated modulation/demodulation signal chains able to ensure efficient transmission and reception of the wideband signal. IoT applications rarely need the kind of maximum data rates possible with modulation techniques such as DSSS. Further, the design complexity and power requirements associated with traditional spread spectrum techniques can make them less effective for low-cost, battery-operated IoT designs.

This is where LoRa comes in. Developed by Semtech, LoRa is a unique spread spectrum modulation method that brings some of the benefits of spread spectrum noise immunity, while simplifying design requirements. LoRa modulation is based on a frequency modulated “chirp” signal that can be generated with a relatively simple fractional-N phase-locked loop (PLL).

When initiating a LoRa transmission, a LoRa modem issues a preamble comprised of a series of chirps (Figure 1, left). The transmission continues with a series of chirps that encode data essentially as frequency jumps in the chirp signal, similar to the use of multiple frequency tones to encode data in M-ary FSK (Figure 1, right).

Image of waterfall view showing the repeated chirps

Figure 1: This waterfall view (newest data at the top) shows the repeated chirps used in the LoRa transmission preamble (left) and the chirps encoding the payload of a transmission (right). (Image source: Link Labs)

On the receiver side, a PLL can lock onto the preamble to initiate reception of a message stream. Because of the distinct pattern of the chirps, a LoRa modem can detect signals as low as 20 dB below the noise floor. LoRa technology enables -148 dBm sensitivity, enabling robust connectivity over very long ranges. Further, a LoRa modem can receive several different transmissions simultaneously, each differing only in chirp rates. As a result, it can support very large numbers of IoT devices operating simultaneously.

LoRa networking

LoRa technology’s unique modulation method lies at the heart of performance characteristics that make it well suited to IoT applications: It can operate successfully at ranges exceeding 15 km in suburban settings and more than 2 km in dense urban environments. It can achieve over 10-year battery life and it can operate in networks comprising up to 1 million nodes. Further, its support for different chirp rates, or “spreading factors,” gives designers the flexibility to trade data rate for range or power as needed to optimize network performance (Figure 2).

Diagram of LoRa technology for IoT developers

Figure 2: With LoRa technology, IoT developers can trade data range for bit rate by using different spreading factors. (Image source: Microchip Technology)

For all its benefits, LoRa is still a physical layer (PHY) mechanism. In an actual IoT application, developers’ ability to apply it as a connectivity solution depends on the availability of a network protocol stack able to build on the LoRa PHY. The LoRaWAN standard does just that with its definition of the media access control (MAC) layer designed to operate with the LoRa PHY. Created and maintained by the LoRa Alliance, the LoRaWAN specification was developed specifically for long-range IoT applications and provides access and control protocols geared for secure, low-power wireless communications.

LoRaWAN defines a familiar IoT hierarchy comprising end devices, local controllers, and cloud-based servers (Figure 3). In LoRaWAN terminology, end devices are connected wirelessly in a star topology to a gateway, and gateways connect through IP networks to a central network server. The network server can double as an IoT application server or connect to one or more separate application servers.

Image of LoRaWAN network topology

Figure 3: The LoRaWAN network topology presents a familiar IoT hierarchy comprising end devices connected wirelessly (dotted lines) to gateways that connect through IP networks (solid lines) to an upstream network server and application servers. (Diagram drawn using Digi-Key Scheme-it)

https://www.digikey.com/schemeit/embed/lorawan-application-PLVM35O2011G/

The LoRaWAN stack provides applications with a standard interface to LoRa-based communications (Figure 4). At the bottom of the stack, the LoRa PHY works with regional sub-GHz ISM bandwidth allocations. Above the LoRa PHY, the LoRaWAN MAC provides familiar MAC-layer services including channel access and addressing. As described below, the LoRaWAN standard defines specific message formats and timing for uplink and downlink transactions.

Image of LoRaWAN media access control (MAC)

Figure 4: Built on the LoRa PHY, the LoRaWAN media access control (MAC) defines the message formats for different device classes. (Image source: LoRa Alliance)

Communications options

The LoRaWAN MAC protocol is designed to support IoT applications with different requirements for downlink communications from a LoRaWAN gateway to an end device. As defined by the LoRa Alliance, the LoRaWAN MAC includes three different classes of devices, all of which support bidirectional communications but differ in their downlink availability:

  • Class A operation supports low-power devices such as wireless sensor nodes that require minimal downlink communication from the server after uplink transmission. A Class A device can transmit data to a gateway any time, but can only receive within two windows, each occurring at a specified delay after the transmission (Figure 5).

Diagram of default Class A transaction

Figure 5: In the default Class A transaction, a device transmits a LoRa-compatible message to a gateway and then listens after preset delays for a response in two receive windows. (Image source: LoRa Alliance)

  • Class B operation extends Class A with additional downlink receive windows. Besides the usual two short receive windows following transmission, a Class B IoT device listens for additional downlink messages at other scheduled windows. The downlink windows occur at specific times following a beacon that is transmitted by a recognized LoRaWAN gateway. Class B downlink scheduling provides a mechanism for applications to contact the IoT device at specific times rather than depending on the non-deterministic downlink windows available in default Class A operation.
  • Class C operations supports devices that need near-continuous availability of downlink receive windows. A Class C device constantly listens for downlink messages except when it is transmitting data or opening the two default receive windows.

LoRaWAN is designed with multiple security features, using a combination of device, session and application crypto keys to encrypt data and to authenticate device access to the network. For a LoRaWAN application, end devices can be programmed at the factory with the authentication information required to join a specific LoRaWAN network, which LoRaWAN calls “activation by personalization”. LoRaWAN also offers “over-the-air activation”, which specifies a procedure for authentication and authorization required for a device to join any available LoRaWAN network.

For network-join operations and secure data communications, only IoT devices and the application server hold crypto secrets (Figure 6). Encrypted messages are simply conveyed, not processed, by the intermediate gateway and network, eliminating their use as an effective attack surface for bad actors.

Image of crypto keys are maintained only in end devices and application servers

Figure 6: In a typical LoRaWAN application, crypto keys are maintained only in end devices and application servers (green highlight). The end-device MCU and upstream IoT application software (red highlight) operate on plain text, while the LoRaWAN gateway and network server (blue highlight) see only encrypted data. (Image source: Microchip Technology)

Simplified communications

Designed to simplify development of LoRaWAN communications, Microchip Technology offers a discrete module that implements LoRa modulation and provides LoRaWAN compatibility. The Microchip RN2903 supports LoRaWAN-compatible communications at the ITU Region 1 ISM standard frequency band of 915 MHz. Along with LoRa modulation, the onboard transceiver also supports FSK and GFSK modulation for proprietary network-protocol design. Similarly, Microchip’s RN2483 provides identical features, supporting the ITU Region 2 ISM bands at 433 or 868 MHz.

Diagram of Microchip LoRa module

Figure 7: The Microchip LoRa module provides a drop-in solution for LoRaWAN connectivity with its onboard command processor, LoRaWAN protocol stack, radio transceiver, and serial connectivity. (Image source: Microchip Technology)

Fully certified, the Microchip module includes all the components required to implement LoRaWAN connectivity (Figure 7). The module’s command processor uses the onboard LoRaWAN firmware to fully support the LoRaWAN Class A protocol. The onboard EEPROM provides storage for LoRaWAN configuration parameters, enhancing performance and increasing security by reducing data transfers between the host and module.

Conclusion

In creating IoT devices intended for long-range communications, developers face a challenge in finding a wireless connectivity able to meet requirements for extended range, long battery life, and sufficient data rate. LoRaWAN can satisfy these demands with unique modulation technology that can achieve a 15 km wireless range and a 10-year battery life. Still, meeting LoRaWAN’s underlying PHY and MAC requirements can stretch development resources and project schedules. Microchip Technology’s RN2903 LoRa module provides a near drop-in solution for implementing LoRaWAN in IoT device designs. As we will discuss in part two, end-device connectivity is only part of a complete LoRaWAN-based IoT application.

In Part 2 of this two-part series, we will discuss how to implement the Microchip RN2903 module using relevant code examples. We will also examine its role in a Microchip LoRaWAN evaluation kit that offers a complete off-the-shelf LoRaWAN-compatible solution including hardware and software for end devices, gateways, and network servers.

LoRaWAN Part 2: How to Use Microchip’s Modules to Speed IoT Design

Contributed By Digi-Key’s North American Editors

Editors Note: In Part 1 of this two-part series, LoRaWAN Part 1: How to Get 15 km Wireless and 10-Year Battery Life for IoT, we looked at the ability of LoRaWAN to meet the need for long-range, low-power IoT communications. Here in Part 2, we will show how developers can use an off-the-shelf kit based on the Microchip Technology RN2903 to implement a LoRaWAN IoT application.

LoRaWAN offers performance characteristics well matched to the needs of the IoT. Besides its extended operating range and low power requirements, LoRaWAN provides secure, flexible communications options. Yet, the hardware and software required to implement a LoRaWAN solution can prove a major obstacle to development teams focused on the IoT application itself.

This article will elaborate on Microchip Technology’s RN2903 LoRa module introduced in Part 1, and show how to use it with some additional hardware and software to realize a long-range, low-power IoT design.

Quick-start kits

Microchip Technology’s RN2903 LoRa module is a near drop-in LoRaWAN hardware solution for an IoT design. Even so, it remains only the cornerstone of a complete LoRaWAN network, and developers must still account for support hardware and software systems. Microchip addresses this need with a comprehensive evaluation kit that provides the additional elements needed to implement LoRaWAN for the IoT.

As mentioned in Part 1, Microchip Technology’s RN2903 supports LoRaWAN-compatible communications at 915 MHz and is designed to simplify development of IoT applications. Fully certified, the Microchip module includes all of the components required to implement LoRaWAN connectivity (Figure 1). The module’s command processor uses the onboard LoRaWAN firmware to fully support the LoRaWAN Class A protocol. The onboard EEPROM provides storage for LoRaWAN configuration parameters, enhancing performance and increasing security by reducing data transfers between the host and module.

Diagram of Microchip’s LoRa module for LoRaWAN connectivity

Figure 1: Microchip’s LoRa module provides a drop-in solution for LoRaWAN connectivity with its onboard command processor, LoRaWAN protocol stack, radio transceiver, and serial connectivity. (Image source: Microchip Technology)

The Microchip RN2903 module provides a dedicated UART interface for communications with an external MCU host. In addition, the module includes 14 GPIO pins that developers can program using module firmware to monitor or control external devices such as switches and LEDs. Finally, the module provides an RF signal pin for easy connection to a simple sleeve dipole antenna.

The module’s command processor performs LoRaWAN transactions according to commands received through its UART interface from an external host MCU. As with any network communications method, LoRaWAN messages are sent and received in specific formats. For LoRaWAN, the LoRa Alliance standard specifies these formats in exacting detail at the byte level. The RN2903 module provides an intuitive text-based approach that abstracts LoRaWAN standard byte-level formats to a set of keyword commands with optional parameters.

Microchip defines three types of keywords:

  1. mac commands for LoRaWAN MAC configuration and control
  2. radio commands targeting the PHY radio layer
  3. sys commands for additional module functions such as providing module firmware version information or accessing the module’s EEPROM store

For example:

mac tx uncnf 30 23A5

sends a message on port 30 with data value “23A5”. The “uncnf” option indicates that the device is not requesting confirmation from the network server. Alternatively, use of the “cnf” option indicates that the device expects the network server to acknowledge receipt. The LoRa module is responsible for encrypting this message before transmitting it to its gateway for delivery to the network server.

radio tx 6d657373616765

transmits a package containing the values [0x6d][0x65][0x73][0x73][0x61][0x67][0x65] (the sample text string “message” in hexadecimal)

sys set nvm 100 FF

stores the value 0xFF at address 0x100 of the user partition in the EEPROM

IoT device design

With its serial interface, the RN2903 requires few additional components to implement a LoRaWAN-compliant IoT hardware design. Microchip further speeds  development with its RN2903 LoRa Mote. Intended to demonstrate its LoRa module capabilities, the Microchip LoRa Mote provides a complete set of hardware and software needed to implement a LoRaWAN-compatible wireless sensor.

The Microchip RN2903 LoRa Mote and RN2483 LoRa Mote each combine the respective LoRa module with a Microchip PIC18LF45K50 8-bit MCU, which serves as host processor for sensor operation and LoRaWAN protocol execution. In addition, the Mote includes light and temperature sensors for the acquisition of sample data, as well as an LCD display for user feedback. The Mote connects to a host computer through a standard USB interface, which provides access to the LoRa module’s UART interface.

During development engineers can execute LoRaWAN operations by sending the macradio, and sys command strings to the module using the Mote’s USB connection. During runtime, code running on the IoT device host would issue commands and process responses as needed for the IoT application. For LoRaWAN applications, Microchip provides an extensive C software library with the Mote hardware. For example, an application-level routine, MOTEapp.c, collects sensor data and transmits the data through the LoRaWAN connection, handling the low-level mac commands expected by the RN2903 (Listing 1).

            . . .

            moteApp_clearBuffers();

            // Make Sure Port is in allowed Range

            // Prepare DataBuffer for Tx

            light = 0;

            temperature = 0;

            NOP();          

            // Measure Sensors

            moteApp_setSensorsInput();

            uint8_t sizeOfUpdate = 0;

            light = moteApp_convertSensorValue(moteApp_getLightValue());

            oled_putString(moteApp_getLightString(), 6, 1);

            sizeOfUpdate = moteApp_addToDataBuffer(moteApp_getLightString(), 4);

           

            temperature = moteApp_convertSensorValue(moteApp_getTempValue());

            temperature = ADC_TempConversion(temperature);

            moteApp_add8bToDataBuffer(temperature, 4 + moteApp_lightStringSize() + 1);

 

            // Do Normal Operation

            . . .

            // Getting Random Channel

            randomPortNum = TMR2_ReadTimer();

            . . .

            // Prepare DataBuffer for Tx

            moteApp_add8bToDataBuffer(randomPortNum, 0);

            dataBuffer[3] = 0x20;

            NOP();

            sendDataCommand("mac tx uncnf ", dataBuffer, 12);

            . . .

Listing 1: Microchip provides C software demonstrating a sample IoT application that collects data from the Mote’s light and temperature sensors, builds a message with the data (add8bToDataBuffer) and transmits the message (sendDataCommand) using the mac tx command. (Code source: Microchip Technology)

Application-level development

Along with the simplified keyword-based command approach, the Microchip LoRa modules and associated Mote development boards significantly simplify development of LoRaWAN end devices. Yet, even the system-level Mote board and its associated software address only the lowest, end-device level of the LoRaWAN hierarchy. A complete LoRaWAN-compatible network requires additional hardware components including compatible gateway(s) and a network server.

Further, in implementing an IoT application, developers must deal with the fact that the LoRa Alliance standard addresses only the lowest levels of the standard OSI stack. As a result, developers need to complete additional networking layers, starting with the OSI network layer that lies above the data link layer addressed by the LoRaWAN MAC standard.

Microchip addresses this need with a hardware and software development kit that implements a complete LoRaWAN-compatible network, including end devices, gateway, and network server. The Microchip RN2903 LoRa Network Evaluation Kit and the RN2483 LoRa Network Evaluation Kit bundle a pair of Motes with Microchip’s LoRaWAN gateway board. The board is comprised of a LoRaWAN gateway core board and an associated radio daughter card complete with antennas and cables.

On the software side, the kit uses the Microchip LoRa Technology Evaluation Suite which provides all of the software components required to fully evaluate an example LoRa system (Figure 2).

Diagram of Microchip's LoRa Network Evaluation Kit and software suite

Figure 2: Microchip’s LoRa Network Evaluation Kit and software suite implement a complete LoRaWAN network application, including end devices (Mote boards), gateway (core board), and network server (mchplora). (Image source: Microchip Technology)

The Suite provides a network server (mchplora) as a docker container designed to run on virtual machine in a development system. The gateway board connects to the development system through USB and communicates wirelessly with the Mote boards. The Mote boards connect through the development system’s USB to the java-based development utilities.

Designed to work with the Evaluation Suite, the Microchip LoRa Development Suite provides a comprehensive java suite that provides a more extensive set of services than available with the Mote C library. For example, to send a MAC transmission, the Development Suite abstracts the underlying transactions to a simple execute method of a macTX class (Listing 2).

  void macTXSendAction()

  {

    if (this.application.device.updateValueFlag)

      this.application.device.wanPojo.setData(this.data.getText());

    if (this.application.device.updateValueFlag) {

      this.application.device.wanPojo.setPortNumber(this.portNumber.getText());

    }

    ICommand macTX = CommandFactory.getCommand(CommandFactory.mactx);

    DeviceModel currDev = this.application.device;

    macTX.setDataModel(currDev);

 

    List task = new ArrayList();

    task.add(macTX);

 

    if (currDev != null)

      this.application.mvcController.execute(task);

    else

      System.err.println("Current Device not set");

  }

Listing 2: The Microchip LoRa Development Suite provides a complete LoRaWAN environment including an extensive set of java packages (jar files) that abstract LoRaWAN transactions such as mac tx to a set of simple software calls such as macTXSendAction(). (Code source: Microchip Technology)

In Listing 2, CommandFactory is a class defined in LoRaDevUtility.jar that defines

  public static String mactx = "mac tx";

and then creates an instance of the appropriate class, in this case, a macTx class object, when the factory is called as CommandFactory.mactx:

    if (command.compareTo(mactx) == 0)

      return new macTX();

The macTX.class in LoRaDevUtility.jar provides runtime configuration values and various service functions such as packet validation as well as the class’ primary utility method, execute. The execute method creates the required mac tx command string in the required format, transmits the message (WriteI2cData), and then acquires the response:

       . . .

          command = new StringBuilder().append("mac tx ").append(((DeviceModel)this.server).wanPojo.getIsConformed()).append(" ").append(((DeviceModel)this.server).wanPojo.getPortNumber()).append(" ").append(((DeviceModel)this.server).wanPojo.getData().replace("0x", "")).toString();

       . . .

        byte[] data = command.getBytes();

        ((DeviceModel)this.server).getController().transport.WriteI2cData(this.processPacket.pack(data), null, this.timeout);

 

        byte[] read = null;

        read = super.readResponseData();

Conclusion

Efficient connectivity is a fundamental requirement for IoT networks comprised of massive numbers of low-power IoT devices. LoRaWAN offers an effective IoT connectivity solution that offers long-range operation with minimal power requirements. As with any connectivity option, implementation can prove a major undertaking in itself, distracting developers from their primary focus on the IoT application itself.

Based on Microchip Technology’s RN2903 LoRa module, Microchip Technology’s LoRa Network Evaluation Kit and accompanying LoRa Development Suite provide a complete LoRaWAN application. Using this combination of pre-certified hardware and software, developers can quickly bring up an IoT connectivity solution able to achieve a 15 km wireless range and 10-year battery life.


Viewing all 764 articles
Browse latest View live