create every day - 福野泰介の一日一創

Making your clock with temperature by IchigoJam x DS3231 without soldering

2017/01/24 23:55:00
#IchigoJam #KidsIT #maker #english 

This is a simple clock on IchigoJam using a real time clock (RTC) DS3231 module.
You can program the movement (display, servo, motor and so on) with alerms when you like!

How to build the Ichigo-Clock
1. Prepere: IchigoJam T (CN5 is I2C pins), DS3231 module, long pin socket
2. Unplug the pin and cut to remain 4 pins (to connect via I2C)

3. Twist and cross the 3 pin and 4pin (because SCK and SDA crossed)

4. Connect the module and the pin socket to CN5 of IchigoJam T.

5. Set the clock (if it's 2017/01/24 07:11:50)

POKE #700,0,#50,#11,#07,0,#24,#01,#17 IF I2CW(#68,#700,1,#701,7) ERR

* #50 = sec, #11 = min, #07 = hour, 0 = dummy, #24 = day, #01 = month, #17 = year

6. Program!

100 VIDEO3 200 @LOOP 210 GOSUB@GETTIME:GOSUB@GETTEMP 220 CLS:LC0,2 230 ?"20";DEC$([0],2);"/";DEC$([1],2);"/";DEC$([2],2) 240 ?" ";DEC$([4],2);":";DEC$([5],2);":";DEC$([6],2) 250 ?"TEMP:";T/10;".";T%10 260 WAIT 60:IF BTN() SWITCH 270 GOTO @LOOP 300 @GETTIME 310 POKE#700,0:IF I2CR(#68,#700,1,#701,7) ERR 320 FOR I=0 TO 6:[I]=PEEK(#707-I):[I]=[I]>>4*10+[I]&15:NEXT 330 RETURN 400 @GETTEMP 410 POKE#700,17:IF I2CR(#68,#700,1,#701,2) ERR 420 T=PEEK(#701)<<2|PEEK(#702)>>6:IF T&#200 T=T|#FC00 430 T=(T*25+5)/10:RETURN

VIDEO3 to enlearge the character on the screen.
300-330 get the time from the RTC module as array(0-6)
400-430 get the temperature from the module as T


This is mobile version! (using the beta firmware)

Tweet
クリエイティブ・コモンズ・ライセンス
この作品は「Creative Commons — CC BY 4.0」の下に提供されています。
CC BY 福野泰介 - Taisuke Fukuno / @taisukef / high-res profile image