This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go get github.com/kidoman/embd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
"github.com/kidoman/embd" | |
_ "github.com/kidoman/embd/host/all" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"github.com/kidoman/embd" | |
_ "github.com/kidoman/embd/host/all" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"github.com/kidoman/embd" | |
_ "github.com/kidoman/embd/host/rpi" // Loads the RPi driver | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/kidoman/embd" | |
... | |
embd.InitGPIO() | |
defer embd.CloseGPIO() | |
... | |
pwm, _ := embd.NewPWMPin("P9_14") | |
defer pwm.Close() | |
... | |
pwm.SetDuty(1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/kidoman/embd" | |
... | |
pin5 := 5 | |
analogResult, err := embd.AnalogRead(pin5) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin1 = 13; | |
const int ledPin2 = 6; | |
const int gnd = 7; | |
const long interval = 1000; | |
int ledState = LOW; | |
void setup() { | |
pinMode(ledPin1, OUTPUT); | |
pinMode(ledPin2, OUTPUT); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin1 = 13; | |
const int ledPin2 = 6; | |
const int tonePin = 8; | |
const int gnd1 = 7; | |
const long interval = 100; | |
int ledState = LOW; | |
void setup() { | |
pinMode(ledPin1, OUTPUT); | |
pinMode(ledPin2, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE users ( | |
id integer NOT NULL, | |
name character varying(1000) DEFAULT ''::character varying NOT NULL, | |
age integer DEFAULT 0 NOT NULL, | |
password character varying(1000) DEFAULT ''::character varying NOT NULL, | |
email character varying(1000) DEFAULT ''::character varying NOT NULL, | |
created_at timestamp with time zone NOT NULL, | |
updated_at timestamp with time zone NOT NULL | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
_ "github.com/mattes/migrate/driver/postgres" | |
"github.com/mattes/migrate/migrate" | |
) |
OlderNewer