+ All Categories
Home > Documents > OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Date post: 13-Jan-2016
Category:
Upload: ashlyn-bennett
View: 214 times
Download: 0 times
Share this document with a friend
14
OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman
Transcript
Page 1: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

OOPic (Object Oriented Pic)

Dominick D’Aniello

Jacques Bosman

Page 2: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Overview

What is the OOPic? What Makes the OOPic Different?

– Hardware Objects– Virtual circuits– Events

The OOPic IDE The OOPic Language Demo

Page 3: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

What is the OOPic?

OOPic is an object oriented operating system (and hardware circuit)

Programmed in a Basic like or Java/C++ style language

Capable of inter-OOPic communications

Page 4: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

What makes the OOPic different?

Physically, the OOPic is nothing more than a Microchip™ Pic microcontroller slapped on a circuit board with some EEPROM and a few pin headers for easy access to the Pic’s pins.

What makes the OOPic unique is the software it runs. The OOPic software allows one to interact with physical hardware, as if it were a OOP software object.

+ =

Page 5: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Hardware Objects

OOPic offers many pre-made “Hardware objects” that provide software mappings to real world hardware.

Objects include something as simple as 1 bit digital IO (An LED or a switch) to something as non trivial as an LCD or a stepper motor.

Allows for intuitive statements such as:

LCD.Operate = 1 ' Turn on the oLCD Object.LCD.Init ' Initialize the LCD Module.LCD.Clear ' Clear the screen.LCD.Locate(0,1) ' Locate cursor at row1, col2.LCD.String = "Hello World" ' Print "Hello World" on LCD.

Page 6: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Virtual Circuits

OOPic allows you to create multiple “Virtual circuits” that run independently of each other and your running code.Dim Button1 As New oDIO1Dim Button2 As New oDIO1Dim RedLed As New oDIO1Dim AndGate As New oGate(2)Button1.IOLine = 1: Button1.Direction = cvInputButton2.IOLine = 2:Button2.Direction = cvInputRedLed.IOLine = 3:RedLed.Direction = cvOutputAndGate.Input1.Link(Button1.Value)AndGate.Input2.Link(Button2.Value)AndGate.Output.Link(RedLed.Value)

Page 7: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Events

The OOPic supports events (interrupts) through the oEvent object

Event is triggered when the oEvent objects operate value goes from 0 to 1.

When the even is triggered the procedure with the same name as the event, followed by “_code” is executed, for example if you have an oEvent object named “bump”, then the procedure named “bump_code” would execute when bump.operate = 1.

Events can have different priorities (lower priorities have precedence)

Events interrupt current program flow, when they return, program flow resumes where it left off.

Page 8: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

The OOPic IDE

The OOpic IDE offers simple editing, flashing, and debugging features.

Code is shown on the left, objects represented in the code are shown on the right.

When the OOPic is connected to the computer you can click on any of the objects in the right hand panel to view and manipulate their current state.

Page 9: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

The OOPic IDE (Cont)

Page 10: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

The OOPic Languages

The OOPic offers 3 basic language modes (Basic and Java/C++ style).

The BASIC style is fairly true to traditional BASIC syntax, however the Java/C++ style is only very loosely related to actual Java and C++ syntax (Basically it has ;’s)

Java and C++ languages types are technically treated differently, but VERY few differences exist.

Page 11: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

The OOPic Languages (cont)

Supports all basic loop and control structures (If/then/else, switch, for, do/while)

Procedures support recursion (limited only by stack space)

Supports arrays of any object type (Arrays are indexed starting at 1, not 0)

Supports user defined objects

Page 12: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

The OOPic Languages (cont)

Dim A As New oDio1Sub Main() A.IOLine = 31 A.Direction = cvOutput Call Blink Call BlinkEnd Sub

Sub Blink() A.Value = cvON OOPic.Wait = 100 A.Value = cvOff OOPic.Wait = 100End Sub

BASIC Java/C++oDio1 A = New oDio1;Sub void main(void){ A.IOLine = 31; A.Direction = cvOutput; Blink(); Blink();}

Sub void Blink(void){ A.Value = cvON; OOPic.Wait = 100; A.Value = cvOff; OOPic.Wait = 100;}

Page 13: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Demo

1. oDio1 LED[8] = New oDio1;2. oWire wires[4] = New oWire;

3. Sub void Main(void)4. {5. OOPic.Node = 2;6. oByte I = New oByte;

7. 8. for (I.Value = 1; I.Value <= 8; I.Value++)9. {10. LED[I.Value].IOLine = (I.Value + 7);11. LED[I.Value].Direction = cvOutput;12. LED[I.Value].set;13. }

14. wires[1].Input.Link(OOPic.Hz1);15. wires[1].Output.Link(LED[5]);16. wires[1].InvertIn = cvFalse;17. wires[1].Operate = cvTrue;

18. wires[2].Input.Link(OOPic.Hz1);19. wires[2].Output.Link(LED[6]);20. wires[2].InvertIn = cvTrue;

Page 14: OOPic (Object Oriented Pic) Dominick D’Aniello Jacques Bosman.

Demo

21. wires[2].Operate = cvTrue;

22. wires[3].Input.Link(OOPic.Hz1);23. wires[3].Output.Link(LED[7]);24. wires[3].InvertIn = cvFalse;25. wires[3].Operate = cvTrue;

26. wires[4].Input.Link(OOPic.Hz1);27. wires[4].Output.Link(LED[8]);28. wires[4].InvertIn = cvTrue;29. wires[4].Operate = cvTrue;

30. Do31. {32. for (I.Value = 1; I.Value <= 4; I.Value++)33. {34. LED[I.Value].value = 0;35. OOPic.delay = 20;36. LED[I.Value].value = 1;37. OOPic.delay = 20;38. }39. } while (1);40. }


Recommended