Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : PicoMite-ExpMini
Author | Message | ||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3152 |
jaybec's post in the "I have a dream" thread gave me an idea: Phone, cable, pico, and -- the missing ingredient -- Terminal app The "ask" The cell phone terminal app--USBTerminal--that he suggested works well--available on Google Play. He included "breadboard", but I thought, why not a PCB which is little larger than the Pico itself? So I wired up a perfboard example: Here is the layout: G G + - P USB P V V RGB Blue 1 | 0 5VUSB | 40 VBUS 5 o o RGB Green 2 | 1 5V | 39 VSYS 6 o o GND 3 | | 38 GND 7 o o RGB Red 4 | 2 | 37 3V3_EN 9 o o 5 | 3 | 36 3V3(out) 10 o o 6 | 4 PicoMite | 35 ADC_VREF 11 o o 7 | 5 Exp- A28 | 34 Traffic Light Green 34 o o GND 8 | Mini | 33 GND/ADCGND 12 o o 34 9 | 6 A27 | 32 Traffic Light Yellow 32 o o 10 | 7 A26 | 31 LDR 14 o o 32 11 | 8 | 30 RUN 31 o o WS2812 12 | 9 22 | 29 Buzzer 29 o o 31 GND 13 | | 28 GND 27 o o Pushbutton 14 | 10 21 | 27 15 o o 15 | 11 20 | 26 26 o o RG_Green 16 | 12 19 | 25 25 o o RG_Red 17 | 13 18 | 24 SCK 16 o o GND 18 | | 23 GND 24 o o 128x64 I2C LCD SDA 19 | 14 17 | 22 DHT11 17 o o SCL 20 | 15 16 | 21 Traffic Light Red 22 o o 21 The columns at the right represent 3 columns of headers placed underneath the PicoMite. In conformity with many of the sensors/switchs in the 37-in-1 kits, 3V3 is the center column, with 0V and signal on either side. The three ADC pins also appear outboard of 0V, also following the 37-in-1 convention. In addition, I wired for a 128x64 I2C display at the bottom, and a rotary encoder at the top (which, with the addition of another 0V pin also allows a 4-pin RGB LED). I didn't wire all the pins on the perfboard, because it was very fiddly, but the sensors shown are wired. Here's a (poor quality) 2-minute youtube video of the board being exercised--run off of a cell phone using USBTerminal: PicoMite-ExpMini I made a PCB--a couple of hours work in EasyEDA (no schematic--because it is simple, I drew it straight to the PCB): Gerbers * are here--$6.62 for 5 from JLCPCB with slow boat shipping: PicoMite-ExpMini_2023-04-21_Gerber.zip Here's the code for this example: ' PicoMite-ExpMini.bas; I2C LCD: OPTION SYSTEM I2C 19,20 OPTION LCDPANEL SSD1306I2C, LANDSCAPE option explicit dim integer i,j,k,l,m,n,iCol,iRow,x,y,iLastSW dim integer fH,fW,iFont,nChRow,nRows,nCols dim string a,c,e,f,g,h,s,lastSecond$ dim float fLDR,fTMP,fHUM,fLastLDR,fLastHUM,fLastTMP Dim integer d%(15),b%(14)=(RGB(red),RGB(green),RGB(blue),0,0,0,0,0,0,0,0,0,0,0,0) b%(3)=RGB(Yellow): b%(4)=RGB(cyan) b%(5)=RGB(gold): b%(6)=RGB(magenta): b%(7)=RGB(brown): b%(8)=RGB(pink) b%(9)=RGB(salmon): b%(10)=RGB(orange):b%(11)=RGB(grey):b%(12)=RGB(white) b%(13)=RGB(lightgrey): b%(14)=RGB(beige) const false=0 const true=1 const pRGB_B=1,pRGB_G=2,pRGB_R=4,pWS2812=12,pPushbutton=14,pRG_G=16,pRG_R=17 const pTraff_R=21,pDHT11=22,pBuzzer=29,pLDR=31,pTraff_Y=32,pTraff_G=34 setpin pPushbutton,DIN,pullup: setpin pLDR,AIN setpin pTraff_R,DOUT:setpin pTraff_G,DOUT:setpin pTraff_Y,DOUT setpin pRGB_B,DOUT: setpin pRGB_G,DOUT: setpin pRGB_R,DOUT setpin pRG_G,DOUT: setpin pRG_R,DOUT: setpin pBuzzer,DOUT fH=mm.fontheight: fW=mm.fontwidth nChRow=mm.hres/fW: nRows=mm.vres/fH cls text 0,0,"PicoMite-ExpMini" do bitbang humid pDHT11,fTMP,fHUM,1 ' 1 for DHT11 if fLastTMP<>fTMP then text 2,fH*1,"Temp: "+str$(fTMP,2,1) fLastTMP=fTMP endif if fLastHUM<>fHUM then text 2,fH*2,"Humidity: "+str$(fHUM,2,1) fLastHUM=fHUM endif fLDR=pin(pLDR) if fLastLDR<>fLDR then text 2,fH*3,"LDR: "+str$(fLDR,1,3) fLastLDR=fLDR endif i=pin(pPushbutton) ' 0 is depressed if iLastSW<>i then iLastSW=i if i then a="OFF" else a="ON " text 2,fH*4,"Pushbutton: "+a endif if iLastSW=0 then: pin(pBuzzer)=1-pin(pBuzzer) else: pin(pBuzzer)=0: endif ' toggle buzzer i=int(rnd*3) select case i case 0: pin(pTraff_R)=1-pin(pTraff_R) case 1: pin(pTraff_G)=1-pin(pTraff_G) case 2: pin(pTraff_Y)=1-pin(pTraff_Y) end select i=int(rnd*3) select case i case 0: pin(pRGB_R)=1-pin(pRGB_R) case 1: pin(pRGB_G)=1-pin(pRGB_G) case 2: pin(pRGB_B)=1-pin(pRGB_B) end select i=int(rnd*2) select case i case 0: pin(pRG_R)=1-pin(pRG_R) case 1: pin(pRG_G)=1-pin(pRG_G) end select For i=0 To 15: j=Int(Rnd*14): d%(i)=b%(j): Next i ' random colors Bitbang ws2812 B,pWS2812,6,d%() pause 1000 loop PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Print this page |