Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
00e1e6bc
Commit
00e1e6bc
authored
Jul 26, 2015
by
Vowstar
Browse files
Merge pull request #572 from devsaurus/dev
Upgrade u8g module and add display bindings
parents
95ee0c68
31128312
Changes
21
Hide whitespace changes
Inline
Side-by-side
lua_examples/u8glib/u8g_rotation.lua
View file @
00e1e6bc
-- ***************************************************************************
-- Rotation Test
--
-- This script executes the rotation features of u8glib to test their Lua
-- integration.
--
-- Note: It is prepared for SSD1306-based displays. Select your connectivity
-- type by calling either init_i2c_display() or init_spi_display() at
-- the bottom of this file.
--
-- ***************************************************************************
-- setup I2c and connect display
-- setup I2c and connect display
function
init_i2c_display
()
function
init_i2c_display
()
...
@@ -20,7 +31,7 @@ function init_spi_display()
...
@@ -20,7 +31,7 @@ function init_spi_display()
local
res
=
0
-- GPIO16
local
res
=
0
-- GPIO16
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
0
)
spi
.
setup
(
1
,
spi
.
MASTER
,
spi
.
CPOL_LOW
,
spi
.
CPHA_LOW
,
spi
.
DATABITS_8
,
0
)
disp
=
u8g
.
ssd1306_128x64_spi
(
cs
,
dc
,
res
)
disp
=
u8g
.
ssd1306_128x64_
hw_
spi
(
cs
,
dc
,
res
)
end
end
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment