today (class35) - blavery.com · today (class35) oled ... . which connector? careful of ... geany,...

36
Today (class35) oled sonar Some more C what is the preprocessor?

Upload: phamcong

Post on 30-Nov-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Today (class35)

oledsonar

Some more C

what is the preprocessor?

SERVO

+5V Gnd Logic -> ESP32 gpio32 (as per myconfig.h)

servo1.ino

RC Servo Motor

“Radio-control” or “hobby” servo motors(We use the tiniest one!)

Various “Horns”

Pulse WIDTH sets angle

http://www.robotplatform.com/knowledge/servo/servo_control_tutorial.html

WhichConnector?

Careful ofAirtronics

pin layout !!

Probably what you have.

servo1.ino

PreprocessorWe’ll look more later on

#define

#include

Exercise: add more

servo steps

OLED demos

Uses Library “esp8266-oled-ssd1306”

Demos copied/tweaked from Files/Examples/Custom Libraries/

“ESP8266 and ESP32 Oled Driver for SSD1306 display”

oledSimpleDemo oledDrawingDemo oledUIDemo oledSimplest << We will look at this in particular

oledSimplest

The oled library esp8266-oled-ssd1306

The API:

See file readme.MD in oled library folder

(Hint: if you can get the “markdown” plugin for geany, geany can read pretty-formatted MD files by pressing F6.)

The available FONTS:

See names in file OLEDDisplayFonts.h in library

Find these in the API and in our sketch

init()

flipScreenVertically()

setFont()

drawString()

display()