July 2, 2014, 9:24 am
This is some very simple hipchat bot code in golang. It will tell you the time in a few locations when you mention it.
package main
import "github.com/daneharrigan/hipchat"
import "fmt"
import "time"
import "strings"
import "log"
func main() {
user := "NNNNN_NNNNNN"
pass := "password"
resource := "bot" //should be bot
roomJid := "[email protected]"
fullName := "mr bot" //seems to need to be lowercase
mentionName := "mrbot"
client, err := hipchat.NewClient(user, pass, resource)
if err != nil {
fmt.Printf("client error: %s\n", err)
return
}
fmt.Printf("Connected\n")
rooms := client.Rooms()
for _, element := range rooms {
fmt.Printf("Room: %s\n", element.Id)
client.Join(element.Id, fullName)
}
client.Status("chat")
// for _,element := range rooms {
// client.Say(element.Id, fullName, "Hello")
// }
for message := range client.Messages() {
if strings.HasPrefix(message.Body, "@"+mentionName) {
t := time.Now()
gmt, er1 := time.LoadLocation("Europe/London")
sf, er2 := time.LoadLocation("America/Los_Angeles")
if er1 != nil {
log.Panic(err)
}
if er2 != nil {
log.Panic(err)
}
timestr := t.Format("Jan 2, 2006 at 3:04pm (MST)")
client.Say(roomJid, fullName, "The time in Japan is:"+timestr)
t = t.In(gmt)
timestr = t.Format("Jan 2, 2006 at 3:04pm (MST)")
client.Say(roomJid, fullName, "The time in London (and Dublin) is:"+timestr)
t = t.In(sf)
timestr = t.Format("Jan 2, 2006 at 3:04pm (MST)")
client.Say(roomJid, fullName, "The time in San Francisco is:"+timestr)
}
}
select {}
}
June 18, 2014, 8:12 am
I picked up an SCK200P Spincoater on ebay. It’s a pretty cheap setup but it’s a kind of neat design. Here are my first quick impressions and a bunch of pictures.
It’s basically, it’s made from off shelf parts, the main controller is a “Fly-dream RC multi-functional tester”. It’s box designed for testing the brushless DC motors they use. The tester and the motor were both designed for the hobbiest radio controlled vehicle market. The spin unit itself is has the motor mounted on a block of thick acrylic. The the chuck attached to the motor is then mounted inside a CD case, the kind of case they use when you buy a bunch of CDRs. That’s actually a nice feature as I can see it being easy to replace. The chuck is exactly 2inches, and the 2inch wafers I have fit on it exactly.
Spinning was pretty easy as you can see in the video above. They provide double sided tape to stick the substrate down (more on this later). The substrate was pretty dirty which caused some issues, but the process otherwise worked well. The biggest problem was removing it! I couldn’t get it off the double sided tape without breaking it. I’ll have to think about how to get round that. I think a jig to hold the substrate in place would be ideal.
Overall I’m reasonably pleased with it so far. That fact that it’s made from standard parts is rather nice, and makes the whole thing quite hackable.






May 20, 2014, 2:16 am
I’ve been reading though the Art of Electronics again, and often find youtube videos help clarify various points. Here’s a list.
Current
I found this write up very useful: and the other writeups on that site. These videos were nice too:
Capacitors
Inductors
Impedance
Diodes
Transistors
BJT:
MOSFET:
Amplifiers (leading to OpAmps)
Differential (OpAmp first stage)
May 7, 2014, 8:28 am
Focusing on getting the captouch controller on this panel working under Linux.
This display: here
Uses this datasheet: here
Which is this captouch controller: here
Raw display module datasheet: here
Initial testing with a Buspirate v4, powered by Buspirate 3.3v supply, pullups enabled:

Buspirate setup commmands, final command scans I2C bus:
m
3
1
2
e
2
W
P
(1)
Output:
I2C>(1)
Searching I2C address space. Found devices at:
0x70(0x38 W) 0x71(0x38 R)
Attached to a Linux System, appearing in i2cdetect now need to compile a kernel module:

