Giter VIP home page Giter VIP logo

go-i2c-oled's Introduction

Typing SVG

About me

Hi there, my name is Jonathan and I'm currently a student at 42 Lyon. I'm in the process of a professional reconversion and I'm excited to be learning new skills in the field of programming. I've been a student at 42 Lyon for 2 year and have been working hard to improve my programming skills.

My interests include back-end development, artificial intelligence, and machine learning. I am passionate about creating bots and automating tasks using Docker. My goal is to become an expert in back-end development and work on projects that utilize the latest technologies. I'm also interested in contributing to open-source projects and collaborating with other developers.

In my free time, I like to stay updated on the latest developments in technology and explore new programming languages and frameworks. I am a big fan of Go and I love to develop with GoLand, and recently I've been diving into Rust, it's a great programming language and I'm excited to learn more about it. I'm always looking for new challenges and opportunities to learn and grow as a developer.

Projects

Skills & Experience

  • I have experience in back-end development using Go and Rust (still learning), and have a deep understanding of the language and its best practices.
  • I have experience in creating bots and automating tasks using Docker. One of my most recent project was a bot for a crypto discord group which allows users to track the prices of different crypto currencies and get alerts when the price of a currency reaches a certain threshold.
  • I have experience in creating Neovim plugin using Go and I have created an app called chatGPT which allows users to interact with OpenAI's GPT-3 language model in real-time.
  • I have experience in working with various databases such as Mysql, MongoDB, and have experience in working with ORM's such as Gorm.
  • I am familiar with Git and have experience in working with Git in a team environment and also have experience in working with Gitlab CI/CD.
  • I am familiar with Linux and have experience in working with Linux servers.
  • I have experience in working with API's and have experience in working with REST API's and GraphQL API's.
๐Ÿ“‡ Contact
Email: [email protected]
Linkedin
๐Ÿ“ˆ Stats
My Github Stats

go-i2c-oled's People

Contributors

waxdred avatar zaporter-work avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zaporter-work

go-i2c-oled's Issues

ssd309 slighly different.

Is there any intention to add the ssd309? The later 128x64 OLED'S come with the newer SSD1309. Apparently it has a few addition registers and a couple of changed values for functions.

Other than that the drawing and text modes are the same.

const (
	SSD1306_CMD                 = 0x80
	SSD1306_SETDISPLAYCLOCKDIV  = 0xD5
	SSD1306_DISPLAYOFF          = 0xAE
	SSD1306_SETMULTIPLEX        = 0xA8
	SSD1306_SETDISPLAYOFFSET    = 0xD3
	SSD1306_SETSTARTLINE        = 0x0
	SSD1306_CHARGEPUMP          = 0x8D
	SSD1306_MEMORYMODE          = 0x20
	SSD1306_SEGREMAP            = 0xA0
	SSD1306_COMSCANDEC          = 0xC8
	SSD1306_SETCOMPINS          = 0xDA
	SSD1306_SETCONTRAST         = 0x81
	SSD1306_SETPRECHARGE        = 0xD9
	SSD1306_SETVCOMDETECT       = 0xDB
	SSD1306_DISPLAYALLON_RESUME = 0xA4
	SSD1306_NORMALDISPLAY       = 0xA6
	SSD1306_EXTERNALVCC         = 0x1
	SSD1306_SWITCHCAPVCC        = 0x2
)
const (
	SSD1309_SETPRECHARGELEVEL = 0xBB
	SSD1309_SETVCOMH          = 0xBE
	SSD1309_NOP               = 0xE3 // No operation command
)

package main

import (
	"image"
	"log"

	"periph.io/x/periph/conn/display/ssd1306"
	"periph.io/x/periph/conn/i2c/i2creg"
	"periph.io/x/periph/host"
)

const (
	SSD1309_DISPLAYOFF          = 0xAE
	SSD1309_SETDISPLAYCLOCKDIV  = 0xD5
	SSD1309_SETMULTIPLEX        = 0xA8
	SSD1309_SETDISPLAYOFFSET    = 0xD3
	SSD1309_SETSTARTLINE        = 0x00
	SSD1309_CHARGEPUMP          = 0x8D
	SSD1309_MEMORYMODE          = 0x20
	SSD1309_SEGREMAP            = 0xA1 // Different from SSD1306
	SSD1309_COMSCANINC          = 0xC0 // Different from SSD1306
	SSD1309_SETCOMPINS          = 0xDA
	SSD1309_SETCONTRAST         = 0x81
	SSD1309_SETPRECHARGE        = 0xD9
	SSD1309_SETVCOMDETECT       = 0xDB
	SSD1309_DISPLAYALLON_RESUME = 0xA4
	SSD1309_NORMALDISPLAY       = 0xA6
	SSD1309_DISPLAYON           = 0xAF
)

func main() {
	// Initialize periph.io.
	if _, err := host.Init(); err != nil {
		log.Fatal(err)
	}

	// Open I2C bus.
	bus, err := i2creg.Open("")
	if err != nil {
		log.Fatal(err)
	}
	defer bus.Close()

	// Create a new display.
	dev, err := ssd1306.NewI2C(bus, &ssd1306.Opts{
		W:         128,
		H:         64,
		Sequential: true, // SSD1309 typically uses Sequential layout
	})
	if err != nil {
		log.Fatal(err)
	}

	// Initialize the display with SSD1309-specific commands.
	cmds := []byte{
		SSD1309_DISPLAYOFF,
		SSD1309_SETDISPLAYCLOCKDIV, 0x80,
		SSD1309_SETMULTIPLEX, 0x3F,
		SSD1309_SETDISPLAYOFFSET, 0x00,
		SSD1309_SETSTARTLINE | 0x00,
		SSD1309_CHARGEPUMP, 0x14,
		SSD1309_MEMORYMODE, 0x00,
		SSD1309_SEGREMAP | 0x01,
		SSD1309_COMSCANINC,
		SSD1309_SETCOMPINS, 0x12,
		SSD1309_SETCONTRAST, 0xCF,
		SSD1309_SETPRECHARGE, 0xF1,
		SSD1309_SETVCOMDETECT, 0x40,
		SSD1309_DISPLAYALLON_RESUME,
		SSD1309_NORMALDISPLAY,
		SSD1309_DISPLAYON,
	}

	for _, cmd := range cmds {
		if err := dev.Command(cmd); err != nil {
			log.Fatal(err)
		}
	}

	// Clear the display.
	img := image.NewGray(image.Rect(0, 0, 128, 64))
	dev.Draw(dev.Bounds(), img, image.Point{})
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.