nrf: I2C interface

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans
2018-10-03 20:34:22 +02:00
committed by Ayke van Laethem
parent 8f7b7e6ee3
commit e4fa1a8288
5 changed files with 110 additions and 13 deletions
+3 -5
View File
@@ -20,20 +20,18 @@ func main() {
count := 0
for {
machine.I2C0.WriteTo(0x09, []byte("n"))
switch count {
case 0:
// Crimson
machine.I2C0.WriteTo(0x09, []byte{0xdc, 0x14, 0x3c})
machine.I2C0.WriteTo(0x09, []byte{'n', 0xdc, 0x14, 0x3c})
count = 1
case 1:
// MediumPurple
machine.I2C0.WriteTo(0x09, []byte{0x93, 0x70, 0xdb})
machine.I2C0.WriteTo(0x09, []byte{'n', 0x93, 0x70, 0xdb})
count = 2
case 2:
// MediumSeaGreen
machine.I2C0.WriteTo(0x09, []byte{0x3c, 0xb3, 0x71})
machine.I2C0.WriteTo(0x09, []byte{'n', 0x3c, 0xb3, 0x71})
count = 0
}