Your SlideShare is downloading. ×
0
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Openwrt, linux e GPIO al LinuxDay 2010 Roma

812

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
812
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. OpenWrt ed elettronica digitale Licenza: http://creativecommons.org/licenses/by-sa/3.0/Autore: Claudio Mignanti c.mignanti<at>gmail.com
  • 2. Linux un po ovunque:● modem/router● NAS● televisioni● stampanti laser http://wiki.ninux.org/Hackalicegate● ascensori● LHCSi mimetizzano intorno a noi....
  • 3. User space Dal sw allhw /dev/gpio /dev/i2c-N /dev/spi-N I2C SPI ... GPIO KERNEL PIOA PIOB PIOC SOC
  • 4. PIOA PA0 1 +5V 0 0 0 0V 0 0 0 PA7 0
  • 5. GPIO Lanello di congiunzioneecho 82 > /sys/class/gpio/exportecho out > /sys/class/gpio/gpio82/directionecho 1 > /sys/class/gpio/gpio82/valueecho 0 > /sys/class/gpio/gpio82/value 5
  • 6. GPIO usando il C #include <stdio.h> #include <gpio_dev.h> int main (void) { fd = open (“/dev/gpio”); ioctl (fd, GPIO_REQUEST, 82); ioctl (fd, GPIO_DIR_OUT); ioctl (fd, GPIO_SET, 1); sleep(1); ioctl (fd, GPIO_SET, 0); } 6trunk/target/linux/generic/files/include/linux/gpi_dev.h
  • 7. Solo led?● Optoisolatori● Relè● Motori● Sensori di vario tipo● …. composizioni varie 7
  • 8. … CNC 8http://wiki.ninux.org/cnc
  • 9. GPIO e stepper motor PYTHON CLASS USER SPACE STEPPER PROGRAM /DEV/GPIO SYSFS /DEV/MOTORn STEPPER DRIVER GPIO API PWM CPU 9http://sourceforge.net/apps/trac/acme-dev/browser/kernel-stuff/stepper-driver/stepper-drv.c
  • 10. class stepper: """ This class allow you to drive a stepper motor using gpio pins.nThe stepper class use the follow paramethers for costructor:n (enable, direction, step, [limit], [low_pwr])n """… def step (self, number=1, delay=0, recover_step=300): self.enable() time.sleep(0.001) for i in range(0, number): #check if at limit if (self.have_limit and self.limit_pin.get() == 0): self.recover_end(recover_step) self.disable() return number - i + recover_step #missing steps self.step_pin.set(0) self.step_pin.set(1) time.sleep(0.001) self.disable() 10 return 0
  • 11. Appuntamento fisso...… alla Domenica nerd (17.30 alle 23.00). Associazione Fusolab Via Giorgio Pitacco 29 ● 11
  • 12. EOF ? Claudio Mignanti c.mignanti<at>gmail.com 12 OpenWrt Hacker - Hardware designerpub 1024D/0DFD7CBB C94D 759A 2EF0 172F 9673 65E4 C4C1 8627 0DFD 7CBB

×